Desktop: Fix to update the note list if the selected tag is deleted. (#2398)

* Refresh the note list if the selected tag is deleted.

* Handle case where last note is untagged (by following the note)

* Corrections.

* Correct call to asynchronous function.
pull/2482/head
mic704b 2020-02-10 09:08:24 +11:00 committed by GitHub
parent d8ef15a1e2
commit cd9d5db3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -443,6 +443,16 @@ class BaseApplication {
refreshNotes = true;
}
if (action.type == 'NOTE_TAG_REMOVE') {
if (newState.notesParentType === 'Tag' && newState.selectedTagId === action.item.id) {
if (newState.notes.length === newState.selectedNoteIds.length) {
await this.refreshCurrentFolder();
refreshNotesUseSelectedNoteId = true;
}
refreshNotes = true;
}
}
if (refreshNotes) {
await this.refreshNotes(newState, refreshNotesUseSelectedNoteId, refreshNotesHash);
}