Skip to content

Commit 1ac241a

Browse files
committed
tidy up code
1 parent 2c447a4 commit 1ac241a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import attributes from "../../services/attributes";
66
import FNote from "../../entities/fnote";
77
import toast from "../../services/toast";
88
import froca from "../../services/froca";
9-
import { useContext, useEffect, useMemo, useState } from "preact/hooks";
9+
import { useContext, useEffect, useState } from "preact/hooks";
1010
import { ParentComponent } from "../react/react_utils";
1111
import { useTriliumEvent } from "../react/hooks";
1212
import appContext from "../../components/app_context";
@@ -75,7 +75,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext }
7575

7676
useEffect(() => {
7777
async function autoExecute() {
78-
if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) {
78+
if (!note || note.type !== "search" || !note.hasLabel("autoExecuteSearch")) {
7979
executionState.save("");
8080
return;
8181
}
@@ -182,10 +182,10 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext }
182182
}
183183

184184
const executionState = function() {
185-
let LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = "";
185+
let lastAutoExecutedSearchNoteId = "";
186186
return {
187-
load: () => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID,
188-
save: (noteId: string) => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = noteId,
187+
load: () => lastAutoExecutedSearchNoteId,
188+
save: (noteId: string) => lastAutoExecutedSearchNoteId = noteId,
189189
};
190190
}();
191191

0 commit comments

Comments
 (0)