diff --git a/apps/readest-app/src/app/reader/components/FoliateViewer.tsx b/apps/readest-app/src/app/reader/components/FoliateViewer.tsx index 8cbd6488..ca08f501 100644 --- a/apps/readest-app/src/app/reader/components/FoliateViewer.tsx +++ b/apps/readest-app/src/app/reader/components/FoliateViewer.tsx @@ -160,7 +160,7 @@ const FoliateViewer: React.FC<{ const initAnnotations = () => { const { booknotes = [] } = config; - const annotations = booknotes.filter((item) => item.type === 'annotation'); + const annotations = booknotes.filter((item) => item.type === 'annotation' && item.style); try { Promise.all(annotations.map((annotation) => view?.addAnnotation(annotation))); } catch (e) { diff --git a/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx b/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx index 0471600e..b5e0fa08 100644 --- a/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx +++ b/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx @@ -14,11 +14,11 @@ interface BooknoteItemProps { const BooknoteItem: React.FC = ({ bookKey, item, editable = false }) => { const { envConfig } = useEnv(); - const { settings, getProgress, getView } = useReaderStore(); - const { getConfig, saveConfig, updateBooknotes, setNotebookEditAnnotation } = useReaderStore(); + const { settings, getConfig, saveConfig, getProgress, getView } = useReaderStore(); + const { updateBooknotes, setNotebookEditAnnotation, setNotebookVisible } = useReaderStore(); const [isCurrent, setIsCurrent] = useState(false); - const { text, cfi } = item; + const { text, cfi, note } = item; const progress = getProgress(bookKey); useEffect(() => { @@ -32,6 +32,9 @@ const BooknoteItem: React.FC = ({ bookKey, item, editable = f const handleClickItem = (event: React.MouseEvent) => { event.preventDefault(); getView(bookKey)?.goTo(cfi); + if (note) { + setNotebookVisible(true); + } }; const deleteNote = (note: BookNote) => { diff --git a/apps/readest-app/src/store/readerStore.ts b/apps/readest-app/src/store/readerStore.ts index a5957341..7bdc84cc 100644 --- a/apps/readest-app/src/store/readerStore.ts +++ b/apps/readest-app/src/store/readerStore.ts @@ -278,7 +278,6 @@ export const useReaderStore = create((set, get) => ({ } const config = get().booksData[id]?.config as BookConfig; const configViewSettings = config.viewSettings!; - console.log('Initializing book view settings', configViewSettings); set((state) => ({ viewStates: { ...state.viewStates,