From 4ec4b22038c61ad9b4b43bbb5846005e833ee9d7 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sat, 25 Jan 2025 02:22:53 +0100 Subject: [PATCH] fix: refresh config to get latest booknotes to show, closes #49 (#245) --- .../src/app/reader/components/annotator/Annotator.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx b/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx index 91f18982..54eff9d0 100644 --- a/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx +++ b/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx @@ -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, );