Skip to content

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

web: close deleted note on sync (#2580)

Muhammad Ali571f15b55610
diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js
index 664babf28..6d10ef863 100644
--- a/apps/web/src/stores/app-store.js
+++ b/apps/web/src/stores/app-store.js
@@ -151,6 +151,7 @@ class AppStore extends BaseStore {
tagStore.refresh();
attachmentStore.refresh();
monographStore.refresh();
+ await editorstore.refresh();
this.refreshNavItems();
logger.measure("refreshing app");
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index 1c3397015..b9596cb8c 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -84,6 +84,11 @@ class EditorStore extends BaseStore {
});
};
+ async refresh() {
+ const sessionId = this.get().session.id;
+ if (sessionId && !db.notes.note(sessionId)) await this.clearSession();
+ }
+
updateSession = async (item) => {
this.set((state) => {
state.session.title = item.title;