From 46ab8b9e9555c43624ddfbb7d2659c9da1242438 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Tue, 19 Jan 2021 13:54:40 +0100 Subject: [PATCH] fix: do not close editor when editing an archived note --- app/assets/javascripts/ui_models/app_state.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/ui_models/app_state.ts b/app/assets/javascripts/ui_models/app_state.ts index 1028099de..63bee0407 100644 --- a/app/assets/javascripts/ui_models/app_state.ts +++ b/app/assets/javascripts/ui_models/app_state.ts @@ -9,6 +9,7 @@ import { DeinitSource, UuidString, SyncOpStatus, + PrefKey, } from '@standardnotes/snjs'; import { WebApplication } from '@/ui_models/application'; import { Editor } from '@/ui_models/editor'; @@ -285,7 +286,14 @@ export class AppState { this.closeEditor(editor); } else if (note.trashed && !this.selectedTag?.isTrashTag) { this.closeEditor(editor); - } else if (note.archived && !this.selectedTag?.isArchiveTag) { + } else if ( + note.archived && + !this.selectedTag?.isArchiveTag && + !this.application.getPreference( + PrefKey.NotesShowArchived, + false + ) + ) { this.closeEditor(editor); } }