feat(hooks): react faster to setting options

This commit is contained in:
Elian Doran 2025-12-19 21:11:57 +02:00
parent 3d9efb23ec
commit 06ad0bfa90
No known key found for this signature in database

View File

@ -168,6 +168,7 @@ export function useTriliumOption(name: OptionNames, needsRefresh?: boolean): [st
const wrappedSetValue = useMemo(() => { const wrappedSetValue = useMemo(() => {
return async (newValue: OptionValue) => { return async (newValue: OptionValue) => {
setValue(String(newValue));
await options.save(name, newValue); await options.save(name, newValue);
if (needsRefresh) { if (needsRefresh) {