From be1f57a8a6aacc4ff090619598b465ff17e4b3d7 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 13 Jul 2019 17:58:59 +0100 Subject: [PATCH] Desktop: Fixes #1727: Keep back button when opening a note link from the search results --- ReactNativeClient/lib/reducer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReactNativeClient/lib/reducer.js b/ReactNativeClient/lib/reducer.js index 981667384b..540b22abd2 100644 --- a/ReactNativeClient/lib/reducer.js +++ b/ReactNativeClient/lib/reducer.js @@ -366,7 +366,10 @@ const reducer = (state = defaultState, action) => { historyNotes.pop(); } newState.historyNotes = historyNotes; - } else { + } else if (newState !== state) { + // Clear the note history if folder and selected note have actually been changed. For example + // they won't change if they are already selected. That way, the "Back" button to go to the + // previous note wll stay. newState.historyNotes = []; }