From a5ea1c5aefbbd574500e0cb255df8eb446092323 Mon Sep 17 00:00:00 2001 From: chrox Date: Wed, 27 Nov 2024 23:30:51 +0100 Subject: [PATCH] Fix unpinned notebook prevent dismiss of annotator popup --- .../src/app/reader/components/annotator/Annotator.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 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 aeacfec5..46ac2b5c 100644 --- a/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx +++ b/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx @@ -30,7 +30,7 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => { const { settings } = useSettingsStore(); const { getConfig, saveConfig, getBookData, updateBooknotes } = useBookDataStore(); const { getProgress, getView, getViewsById } = useReaderStore(); - const { notebookNewAnnotation } = useNotebookStore(); + const { isNotebookPinned, isNotebookVisible } = useNotebookStore(); const { setNotebookVisible, setNotebookNewAnnotation } = useNotebookStore(); const globalReadSettings = settings.globalReadSettings; const config = getConfig(bookKey)!; @@ -103,7 +103,6 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => { setSelectedStyle(annotation.style!); setSelectedColor(annotation.color!); setSelection(selection); - console.log('show annotation', selection); }; useFoliateEvents(view, { onLoad, onDrawAnnotation, onShowAnnotation }, [config]); @@ -311,7 +310,7 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => { return (
{(showAnnotPopup || showWiktionaryPopup || showWikipediaPopup || showDeepLPopup) && - !notebookNewAnnotation && ( + (!isNotebookVisible || isNotebookPinned) && (