web: close deleted note on sync (#2580)

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
This commit is contained in:
Muhammad Ali
2023-05-25 12:14:49 +05:00
committed by GitHub
parent 283efa6e41
commit 571f15b556
2 changed files with 6 additions and 0 deletions

View File

@@ -151,6 +151,7 @@ class AppStore extends BaseStore {
tagStore.refresh();
attachmentStore.refresh();
monographStore.refresh();
await editorstore.refresh();
this.refreshNavItems();
logger.measure("refreshing app");

View File

@@ -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;