1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2026-01-14 21:35:21 +00:00
ArisuAutoSweeper/webapp/packages/renderer/src/logics/initAppConfigStore.ts

15 lines
586 B
TypeScript

import {useAppStore} from '/@/store/modules/app';
import {repositoryValueMap} from '/@/settings/repositorySeeing';
export async function initAppConfigStore() {
const appStore = useAppStore();
const config = await window.__electron_preload__getAlasConfig();
appStore.setTheme(config?.theme ?? 'light');
appStore.setLanguage(config?.language ?? 'zh-CN');
appStore.setRepository(
(repositoryValueMap[config?.repository] as 'global' | 'china') ?? 'global',
);
appStore.setWebuiUrl(config?.webuiUrl ?? '127.0.0.1:23467');
appStore.setAlasPath(config?.alasPath ?? '');
}