mirror of
https://github.com/zadam/trilium.git
synced 2025-12-04 14:34:24 +01:00
use module level var instead of sessionStorage
This commit is contained in:
parent
6c1886c5ca
commit
2c447a4293
@ -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(() => {
|
useEffect(() => {
|
||||||
async function autoExecute() {
|
async function autoExecute() {
|
||||||
if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) {
|
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 }) {
|
function BulkActionsList({ note }: { note: FNote }) {
|
||||||
const [ bulkActions, setBulkActions ] = useState<RenameNoteBulkAction[]>();
|
const [ bulkActions, setBulkActions ] = useState<RenameNoteBulkAction[]>();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user