From aa952d2ced1f1921837aad49428d1dcd09f302b0 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 26 Dec 2023 13:15:14 +0500 Subject: [PATCH] web: fix previewing trashed notes --- apps/web/src/stores/editor-store.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts index 07b5a0fd1..1a4693ee6 100644 --- a/apps/web/src/stores/editor-store.ts +++ b/apps/web/src/stores/editor-store.ts @@ -146,7 +146,8 @@ class EditorStore extends BaseStore { return; } - const note = await db.notes.note(noteId); // TODO: || db.notes.trashed(noteId); + const note = + (await db.notes.note(noteId)) || (await db.notes.trashed(noteId)); if (!note) return; noteStore.setSelectedNote(note.id); @@ -173,11 +174,11 @@ class EditorStore extends BaseStore { attachmentsLength: 0 // TODO: db.attachments.ofNote(note.id, "all")?.length || 0 }; - // TODO: const isDeleted = note.type === "trash"; - // if (isDeleted) { - // state.session.isDeleted = true; - // state.session.readonly = true; - // } + const isDeleted = note.type === "trash"; + if (isDeleted) { + state.session.isDeleted = true; + state.session.readonly = true; + } }); appStore.setIsEditorOpen(true); this.toggleProperties(false);