feat: slightly better config

This commit is contained in:
2025-02-25 02:01:24 +01:00
parent b7fe76b6ff
commit 43fd622322
7 changed files with 150 additions and 30 deletions

View File

@ -25,7 +25,7 @@ export const usePkgStore = defineStore('pkg', {
profile: (state) => state.prf,
isEnabled: (state) => (pkg: Package | undefined) =>
pkg !== undefined && state.prf?.mods.includes(pkgKey(pkg)),
cfg: (state) => (key: string) => state.prf?.cfg[key]
cfg: (state) => (key: string) => state.prf?.cfg[key],
},
actions: {
setupListeners() {
@ -102,9 +102,9 @@ export const usePkgStore = defineStore('pkg', {
},
async set_cfg(key: string, value: string | boolean | number) {
await invoke('set_cfg', { key, value: `${value}` });
await invoke('set_cfg', { key, value });
await this.reloadProfile();
await this.saveProfile();
}
},
},
});
});