diff --git a/apps/web/src/components/notebook/index.tsx b/apps/web/src/components/notebook/index.tsx index e1f07044b..67caaa363 100644 --- a/apps/web/src/components/notebook/index.tsx +++ b/apps/web/src/components/notebook/index.tsx @@ -65,10 +65,12 @@ export function Notebook(props: NotebookProps) { refresh = () => {}, depth = 0 } = props; - const isOpened = useNotesStore( - (store) => - store.context?.type === "notebook" && store.context.id === item.id + const currentContext = useNotesStore((store) => + store.context?.type === "notebook" && store.context.id === item.id + ? store.contextNotes + : null ); + const isOpened = !!currentContext; const dragTimeout = useRef(0); const { isDragEntering, isDragLeaving } = useDragHandler(`id_${item.id}`); @@ -154,7 +156,11 @@ export function Notebook(props: NotebookProps) { } - footer={{totalNotes}} + footer={ + + {currentContext ? currentContext?.length : totalNotes} + + } menuItems={notebookMenuItems} context={{ refresh }} sx={{