Skip to content

Commit bf4845e

Browse files
committed
fix: delay app settings initialization until env is ready
1 parent 75fe383 commit bf4845e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

frontend/src/stores/appSettings.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export const useAppSettingsStore = defineStore('app-settings', () => {
7373
testUrl: DefaultTestURL,
7474
concurrencyLimit: DefaultConcurrencyLimit,
7575
controllerCloseMode: ControllerCloseMode.All,
76-
main: DefaultCoreConfig(),
77-
alpha: DefaultCoreConfig(),
76+
main: undefined as any,
77+
alpha: undefined as any,
7878
},
7979
addPluginToMenu: false,
8080
addGroupToMenu: false,
@@ -94,6 +94,11 @@ export const useAppSettingsStore = defineStore('app-settings', () => {
9494
const data = await ignoredError(ReadFile, UserFilePath)
9595
data && (app.value = Object.assign(app.value, parse(data)))
9696

97+
if (!app.value.kernel.main) {
98+
app.value.kernel.main = DefaultCoreConfig()
99+
app.value.kernel.alpha = DefaultCoreConfig()
100+
}
101+
97102
if (app.value.kernel.controllerCloseMode === undefined) {
98103
app.value.kernel.controllerCloseMode = ControllerCloseMode.All
99104
}
@@ -111,11 +116,6 @@ export const useAppSettingsStore = defineStore('app-settings', () => {
111116
delete app.value['font-family']
112117
}
113118

114-
if (!app.value.kernel.main) {
115-
app.value.kernel.main = DefaultCoreConfig()
116-
app.value.kernel.alpha = DefaultCoreConfig()
117-
}
118-
119119
if (!app.value.kernel.cardColumns) {
120120
app.value.kernel.cardColumns = DefaultCardColumns
121121
}

0 commit comments

Comments
 (0)