From 7580a0f266959f4c781da01efc00c65926da74f8 Mon Sep 17 00:00:00 2001 From: xishang0128 Date: Fri, 21 Feb 2025 03:09:12 +0800 Subject: [PATCH] fix hosts input --- src/main/utils/init.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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' })