fix: do not close editor when editing an archived note

This commit is contained in:
Baptiste Grob
2021-01-19 13:54:40 +01:00
parent d46f1fec5b
commit 46ab8b9e95

View File

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