From cd9d5db3c2133d7654ff24ef4e2f549c0a705274 Mon Sep 17 00:00:00 2001 From: mic704b Date: Mon, 10 Feb 2020 09:08:24 +1100 Subject: [PATCH] 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. --- ReactNativeClient/lib/BaseApplication.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index a1e905def..1ae4a52f0 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -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); }