From 2c447a4293f18c380c20a15c5c594e2993146a19 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 23:53:50 +0200 Subject: [PATCH] use module level var instead of sessionStorage --- .../src/widgets/ribbon/SearchDefinitionTab.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 0a9e9ba43..61c6f59db 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -73,14 +73,6 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } } }); - const executionState = useMemo(() => { - const AUTO_EXEC_KEY = "lastAutoExecutedSearchNote"; - return { - load: () => sessionStorage.getItem(AUTO_EXEC_KEY), - save: (noteId: string) => sessionStorage.setItem(AUTO_EXEC_KEY, noteId), - }; - }, []); - useEffect(() => { async function autoExecute() { if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) { @@ -189,6 +181,14 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } ) } +const executionState = function() { + let LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = ""; + return { + load: () => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID, + save: (noteId: string) => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = noteId, + }; +}(); + function BulkActionsList({ note }: { note: FNote }) { const [ bulkActions, setBulkActions ] = useState();