fix(koplugin): avoid resurrecting deleted annotations on pull (#3639)

Closes #3621.
This commit is contained in:
Lee Kai Ze
2026-03-26 22:13:32 +08:00
committed by GitHub
parent bb82ab6c8a
commit c7e82825f5
2 changed files with 1 additions and 2 deletions
@@ -682,7 +682,6 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
const color = settings.globalReadSettings.highlightStyles[style];
setSelectedStyle(style);
setSelectedColor(color);
console.log('Adding annotation:', cfi, 'style:', style, 'color:', color);
const annotation: BookNote = {
id: uniqueId(),
type: 'annotation',
@@ -177,7 +177,7 @@ export const useNotesSync = (bookKey: string) => {
convertedNotes.forEach((note) => {
if (note.cfi) {
const index = getIndexFromCfi(note.cfi);
if (index === view?.renderer.primaryIndex) {
if (!note.deletedAt && index === view?.renderer.primaryIndex) {
view.addAnnotation(note);
}
}