From 1ac241ad1bec51000d73cee3c3f4542557235933 Mon Sep 17 00:00:00 2001 From: contributor Date: Sun, 23 Nov 2025 00:08:57 +0200 Subject: [PATCH] tidy up code --- apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 61c6f59db..29cbb8212 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -6,7 +6,7 @@ import attributes from "../../services/attributes"; import FNote from "../../entities/fnote"; import toast from "../../services/toast"; import froca from "../../services/froca"; -import { useContext, useEffect, useMemo, useState } from "preact/hooks"; +import { useContext, useEffect, useState } from "preact/hooks"; import { ParentComponent } from "../react/react_utils"; import { useTriliumEvent } from "../react/hooks"; import appContext from "../../components/app_context"; @@ -75,7 +75,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } useEffect(() => { async function autoExecute() { - if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) { + if (!note || note.type !== "search" || !note.hasLabel("autoExecuteSearch")) { executionState.save(""); return; } @@ -182,10 +182,10 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } } const executionState = function() { - let LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = ""; + let lastAutoExecutedSearchNoteId = ""; return { - load: () => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID, - save: (noteId: string) => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = noteId, + load: () => lastAutoExecutedSearchNoteId, + save: (noteId: string) => lastAutoExecutedSearchNoteId = noteId, }; }();