From 542a5e88b76860e853a18b260f04140f297a5a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kil=C3=A5ker?= Date: Thu, 4 Apr 2019 08:48:33 +0200 Subject: [PATCH] All: 1383 Clear selected Notes when switching Notebook (#1387) --- ReactNativeClient/lib/reducer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactNativeClient/lib/reducer.js b/ReactNativeClient/lib/reducer.js index f75d8bb47..0c3140ea1 100644 --- a/ReactNativeClient/lib/reducer.js +++ b/ReactNativeClient/lib/reducer.js @@ -218,6 +218,7 @@ function changeSelectedFolder(state, action, options = null) { if (newState.selectedFolderId === state.selectedFolderId && newState.notesParentType === state.notesParentType) return state; if (options.clearNoteHistory) newState.historyNotes = []; + if (options.clearSelectedNoteIds) newState.selectedNoteIds = []; return newState; } @@ -348,7 +349,7 @@ const reducer = (state = defaultState, action) => { case 'FOLDER_SELECT': - newState = changeSelectedFolder(state, action); + newState = changeSelectedFolder(state, action, { clearSelectedNoteIds: true }); break; case 'FOLDER_AND_NOTE_SELECT':