fix: refresh config to get latest booknotes to show, closes #49 (#245)

This commit is contained in:
Huang Xin
2025-01-25 02:22:53 +01:00
committed by GitHub
parent 6b09145546
commit 4ec4b22038
@@ -114,7 +114,7 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
if (osPlatform === 'android') {
makeSelection(sel, false);
}
} else {
} else if (!isUpToShowPopup.current) {
isTextSelected.current = false;
setShowAnnotPopup(false);
}
@@ -159,7 +159,7 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
const onShowAnnotation = (event: Event) => {
const detail = (event as CustomEvent).detail;
const { value: cfi, index, range } = detail;
const { booknotes = [] } = config;
const { booknotes = [] } = getConfig(bookKey)!;
const annotations = booknotes.filter(
(booknote) => booknote.type === 'annotation' && !booknote.deletedAt,
);