fix: avoid changing selected note when editing archived or trashed note from search results
This commit is contained in:
@@ -246,11 +246,16 @@ export class AppState {
|
|||||||
}
|
}
|
||||||
if (note.deleted) {
|
if (note.deleted) {
|
||||||
this.closeEditor(editor);
|
this.closeEditor(editor);
|
||||||
} else if (note.trashed && !this.selectedTag?.isTrashTag) {
|
} else if (
|
||||||
|
note.trashed &&
|
||||||
|
!this.selectedTag?.isTrashTag &&
|
||||||
|
!this.searchOptions.includeTrashed
|
||||||
|
) {
|
||||||
this.closeEditor(editor);
|
this.closeEditor(editor);
|
||||||
} else if (
|
} else if (
|
||||||
note.archived &&
|
note.archived &&
|
||||||
!this.selectedTag?.isArchiveTag &&
|
!this.selectedTag?.isArchiveTag &&
|
||||||
|
!this.searchOptions.includeArchived &&
|
||||||
!this.application.getPreference(PrefKey.NotesShowArchived, false)
|
!this.application.getPreference(PrefKey.NotesShowArchived, false)
|
||||||
) {
|
) {
|
||||||
this.closeEditor(editor);
|
this.closeEditor(editor);
|
||||||
|
|||||||
@@ -277,7 +277,11 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
|
|||||||
if (this.application.getAppState().notes.selectedNotesCount < 2) {
|
if (this.application.getAppState().notes.selectedNotesCount < 2) {
|
||||||
if (activeNote) {
|
if (activeNote) {
|
||||||
const discarded = activeNote.deleted || activeNote.trashed;
|
const discarded = activeNote.deleted || activeNote.trashed;
|
||||||
if (discarded && !this.appState?.selectedTag?.isTrashTag) {
|
if (
|
||||||
|
discarded &&
|
||||||
|
!this.appState?.selectedTag?.isTrashTag &&
|
||||||
|
!this.appState?.searchOptions.includeTrashed
|
||||||
|
) {
|
||||||
this.selectNextOrCreateNew();
|
this.selectNextOrCreateNew();
|
||||||
} else if (!this.state.selectedNotes[activeNote.uuid]) {
|
} else if (!this.state.selectedNotes[activeNote.uuid]) {
|
||||||
this.selectNote(activeNote);
|
this.selectNote(activeNote);
|
||||||
|
|||||||
Reference in New Issue
Block a user