mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: fix note counts not updating in notebooks list
This commit is contained in:
@@ -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) {
|
||||
</Text>
|
||||
</Flex>
|
||||
}
|
||||
footer={<Text variant="subBody">{totalNotes}</Text>}
|
||||
footer={
|
||||
<Text variant="subBody">
|
||||
{currentContext ? currentContext?.length : totalNotes}
|
||||
</Text>
|
||||
}
|
||||
menuItems={notebookMenuItems}
|
||||
context={{ refresh }}
|
||||
sx={{
|
||||
|
||||
Reference in New Issue
Block a user