diff --git a/src/main/utils/init.ts b/src/main/utils/init.ts index e0b9ae87..317cdc29 100644 --- a/src/main/utils/init.ts +++ b/src/main/utils/init.ts @@ -156,7 +156,8 @@ async function migration(): Promise { useSubStore = true, showFloatingWindow = false, disableTray = false, - encryptedPassword + encryptedPassword, + hosts = [], } = await getAppConfig() const { 'external-controller-pipe': externalControllerPipe, @@ -192,6 +193,10 @@ async function migration(): Promise { if (!lanDisallowedIps) { await patchControledMihomoConfig({ 'lan-disallowed-ips': [] }) } + // add default hosts + if (!hosts.length) { + await patchAppConfig({ hosts: [] }) + } // remove custom app theme if (!['system', 'light', 'dark'].includes(appTheme)) { await patchAppConfig({ appTheme: 'system' })