diff --git a/apps/mobile/app/components/side-menu/notebook-item.tsx b/apps/mobile/app/components/side-menu/notebook-item.tsx index e6538e0f9..625eba1be 100644 --- a/apps/mobile/app/components/side-menu/notebook-item.tsx +++ b/apps/mobile/app/components/side-menu/notebook-item.tsx @@ -35,6 +35,7 @@ import AppIcon from "../ui/AppIcon"; import { IconButton } from "../ui/icon-button"; import { Pressable } from "../ui/pressable"; import Paragraph from "../ui/typography/paragraph"; +import { useRelationStore } from "../../stores/use-relation-store"; export const NotebookItem = ({ index, @@ -70,13 +71,14 @@ export const NotebookItem = ({ const notebook = item.notebook; const isFocused = focused; const { totalNotes, getTotalNotes } = useTotalNotes("notebook"); + const updater = useRelationStore(state => state.updater); const getTotalNotesRef = React.useRef(getTotalNotes); getTotalNotesRef.current = getTotalNotes; const { colors } = useThemeColors(); useEffect(() => { getTotalNotesRef.current([item.notebook.id]); - }, [item.notebook]); + }, [item.notebook, updater]); useEffect(() => { const onNotebookUpdate = (id?: string) => { diff --git a/apps/mobile/app/utils/functions.ts b/apps/mobile/app/utils/functions.ts index f6f7aca97..c01e2dffe 100644 --- a/apps/mobile/app/utils/functions.ts +++ b/apps/mobile/app/utils/functions.ts @@ -211,6 +211,7 @@ export const deleteItems = async ( useNotebookStore.getState().refresh(); } useMenuStore.getState().setMenuPins(); + useRelationStore.getState().update(); }; export const openLinkInBrowser = async (link: string) => {