From 448aa5b2f24653c0d735cf4cf7035d2c4c773eb6 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Tue, 14 Apr 2026 22:43:48 +0500 Subject: [PATCH] mobile: fix monograph count does not update on unpublishing note in side-menu --- .../app/components/sheets/publish-note/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app/components/sheets/publish-note/index.tsx b/apps/mobile/app/components/sheets/publish-note/index.tsx index 4128ea9cc..5f1c96c85 100644 --- a/apps/mobile/app/components/sheets/publish-note/index.tsx +++ b/apps/mobile/app/components/sheets/publish-note/index.tsx @@ -33,7 +33,11 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import ToggleSwitch from "toggle-switch-react-native"; import { db } from "../../../common/database"; import { requestInAppReview } from "../../../services/app-review"; -import { presentSheet, ToastManager } from "../../../services/event-manager"; +import { + eSendEvent, + presentSheet, + ToastManager +} from "../../../services/event-manager"; import Navigation from "../../../services/navigation"; import { useAttachmentStore } from "../../../stores/use-attachment-store"; import { openLinkInBrowser } from "../../../utils/functions"; @@ -47,6 +51,7 @@ import Heading from "../../ui/typography/heading"; import Paragraph from "../../ui/typography/paragraph"; import { useAsync } from "react-async-hook"; import { isFeatureAvailable, useIsFeatureAvailable } from "@notesnook/common"; +import { eMenuItemUpdate } from "../../../utils/events"; async function fetchMonographData(noteId: string) { const monographId = db.monographs.monograph(noteId); @@ -55,7 +60,7 @@ async function fetchMonographData(noteId: string) { : undefined; return { monograph, - monographId, + monographId }; } @@ -112,6 +117,7 @@ const PublishNoteSheet = ({ await monographData.execute(); Navigation.queueRoutesForUpdate(); + eSendEvent(eMenuItemUpdate); setPublishLoading(false); } requestInAppReview(); @@ -138,6 +144,7 @@ const PublishNoteSheet = ({ await db.monographs.unpublish(note.id); monographData.execute(); Navigation.queueRoutesForUpdate(); + eSendEvent(eMenuItemUpdate); setPublishLoading(false); } } catch (e) {