Skip to content

Commit

Permalink
Notify the reader about deleted annotations. Fix #561
Browse files Browse the repository at this point in the history
  • Loading branch information
tnajdek committed Aug 21, 2024
1 parent d2821f3 commit 1598abb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/js/component/reader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,13 @@ const Reader = () => {
}).filter(a => {
return !deepEqual(a, prevAnnotations.find(pa => pa.key === a.key))
});

const deletedAnnotations = prevAnnotations
.filter(pa => !annotations.find(a => a.key === pa.key))
.map(a => a.key);

reader.current.setAnnotations(getProcessedAnnotations(changedAnnotations));
reader.current.unsetAnnotations(deletedAnnotations);
}
}, [annotations, getProcessedAnnotations, isBusy, prevAnnotations, state.importedAnnotations, state.isReady, wasBusy]);

Expand Down

0 comments on commit 1598abb

Please sign in to comment.