forked from akanyan/STARTLINER
feat: rudimentary config
This commit is contained in:
@ -25,6 +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]
|
||||
},
|
||||
actions: {
|
||||
setupListeners() {
|
||||
@ -99,5 +100,11 @@ export const usePkgStore = defineStore('pkg', {
|
||||
await this.reloadProfile();
|
||||
await this.saveProfile();
|
||||
},
|
||||
|
||||
async set_cfg(key: string, value: string | boolean | number) {
|
||||
await invoke('set_cfg', { key, value: `${value}` });
|
||||
await this.reloadProfile();
|
||||
await this.saveProfile();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user