fix: avoid changing selected note when editing archived or trashed note from search results

This commit is contained in:
Antonella Sgarlatta
2021-07-19 12:15:35 -03:00
parent ffc84a7ab6
commit 0b8cd1b7b4
2 changed files with 11 additions and 2 deletions

View File

@@ -277,7 +277,11 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
if (this.application.getAppState().notes.selectedNotesCount < 2) {
if (activeNote) {
const discarded = activeNote.deleted || activeNote.trashed;
if (discarded && !this.appState?.selectedTag?.isTrashTag) {
if (
discarded &&
!this.appState?.selectedTag?.isTrashTag &&
!this.appState?.searchOptions.includeTrashed
) {
this.selectNextOrCreateNew();
} else if (!this.state.selectedNotes[activeNote.uuid]) {
this.selectNote(activeNote);