mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 17:26:38 +01:00
chore(react/settings): make layout switch functional
This commit is contained in:
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user