fix(koplugin): avoid resurrecting deleted annotations on pull (#3639)
Closes #3621.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user