fix: draw annotations of the current section on load, closes #2163 (#2174)

This commit is contained in:
Huang Xin
2025-10-05 23:47:34 +08:00
committed by GitHub
parent 2a5758fbc4
commit ec397a2daf
@@ -178,6 +178,13 @@ const FoliateViewer: React.FC<{
manageSyntaxHighlighting(detail.doc, viewSettings);
}
setTimeout(() => {
const booknotes = config.booknotes || [];
booknotes
.filter((item) => !item.deletedAt && item.type === 'annotation' && item.style)
.forEach((annotation) => viewRef.current?.addAnnotation(annotation));
}, 100);
if (!detail.doc.isEventListenersAdded) {
// listened events in iframes are posted to the main window
// and then used by useMouseEvent and useTouchEvent