Fix tauri permission issues (#977)

This commit is contained in:
Uriel
2024-04-04 23:11:30 -03:00
committed by GitHub
parent 7df8c5d858
commit b310cf0e0e
2 changed files with 10 additions and 1 deletions

View File

@@ -21,8 +21,12 @@
"window:allow-toggle-maximize",
"window:allow-minimize",
"window:allow-start-dragging",
"window:allow-hide",
"window:allow-show",
"window:allow-set-focus",
"shell:allow-open",
"store:allow-get",
"store:allow-set"
"store:allow-set",
"store:allow-save"
]
}

View File

@@ -36,6 +36,7 @@ export interface ConfigContext {
loading: boolean;
setConfig: (config: Partial<Config>) => Promise<void>;
loadConfig: () => Promise<Config | null>;
saveConfig: () => Promise<void>;
}
export const defaultConfig: Omit<Config, 'devSettings'> = {
@@ -157,6 +158,10 @@ export function useConfigProvider(): ConfigContext {
return null;
}
},
saveConfig: async () => {
if (!tauri) return;
await (store as Store).save();
},
};
}