From c273fd4d6315e43c1c95affa3aa189600537a2bb Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Wed, 6 May 2020 23:17:03 +0100 Subject: [PATCH] Desktop: Fixed regression with local search (could not be closed anymore) --- .../gui/NoteEditor/utils/useWindowCommandHandler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.ts b/ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.ts index 7c26f9528b..509bbaaf5e 100644 --- a/ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.ts +++ b/ElectronClient/gui/NoteEditor/utils/useWindowCommandHandler.ts @@ -62,8 +62,10 @@ export default function useWindowCommandHandler(dependencies:HookDependencies) { if (editorRef.current && editorRef.current.supportsCommand('search')) { editorCmd.name = 'search'; } else { - setShowLocalSearch(true); - if (noteSearchBarRef.current) noteSearchBarRef.current.wrappedInstance.focus(); + fn = () => { + setShowLocalSearch(true); + if (noteSearchBarRef.current) noteSearchBarRef.current.wrappedInstance.focus(); + }; } } else if (command.name === 'insertTemplate') { editorCmd.name = 'insertText',