Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix monograph publish status not updating

Abdullah Atta34be765ac54b
diff --git a/apps/web/src/components/note/index.tsx b/apps/web/src/components/note/index.tsx
index 16df3be81..4e494fca2 100644
--- a/apps/web/src/components/note/index.tsx
+++ b/apps/web/src/components/note/index.tsx
@@ -64,6 +64,7 @@ import { store, useStore } from "../../stores/note-store";
import { store as userstore } from "../../stores/user-store";
import { store as editorStore } from "../../stores/editor-store";
import { store as tagStore } from "../../stores/tag-store";
+import { useStore as useMonographStore } from "../../stores/monograph-store";
import { db } from "../../common/db";
import { showToast } from "../../utils/toast";
import { hashNavigate, navigate } from "../../navigation";
@@ -431,7 +432,7 @@ const menuItems: (
isChecked: db.monographs.isPublished(note.id),
onClick: async () => {
const isPublished = db.monographs.isPublished(note.id);
- if (isPublished) await db.monographs.unpublish(note.id);
+ if (isPublished) await useMonographStore.getState().unpublish(note.id);
else await showPublishView(note, "bottom");
}
},