chore(react/settings): make layout switch functional

This commit is contained in:
Elian Doran
2025-08-14 17:57:08 +03:00
parent d6032c912e
commit 6685e583f2
4 changed files with 12 additions and 17 deletions

View File

@@ -68,12 +68,12 @@ export function useSpacedUpdate(callback: () => Promise<void>, interval = 1000)
return spacedUpdateRef.current;
}
export function useTriliumOption(name: OptionNames): [string, (newValue: string) => void] {
export function useTriliumOption(name: OptionNames): [string, (newValue: string) => Promise<void>] {
const initialValue = options.get(name);
const [ value, setValue ] = useState(initialValue);
function wrappedSetValue(newValue: string) {
options.save(name, newValue);
async function wrappedSetValue(newValue: string) {
await options.save(name, newValue);
};
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {