From b30a2856cb38cb0bda16cde29758305ff027cd86 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 10 May 2025 10:34:11 +0800 Subject: [PATCH] update --- src/main/modules/winMain/main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/modules/winMain/main.ts b/src/main/modules/winMain/main.ts index 42a11488..4bc1214e 100644 --- a/src/main/modules/winMain/main.ts +++ b/src/main/modules/winMain/main.ts @@ -66,7 +66,7 @@ export const createWindow = () => { const { shouldUseDarkColors, theme } = global.lx.theme const ses = session.fromPartition('persist:win-main') const proxy = getProxy() - setSesProxy(ses, proxy?.host, String(proxy?.port)) + setSesProxy(ses, proxy?.host, proxy?.port) /** * Initial window options @@ -127,7 +127,7 @@ export const closeWindow = () => { browserWindow.close() } -const setSesProxy = (ses: Electron.Session, host?: string, port?: string) => { +const setSesProxy = (ses: Electron.Session, host?: string, port?: string | number) => { if (host) { void ses.setProxy({ mode: 'fixed_servers', @@ -142,7 +142,7 @@ const setSesProxy = (ses: Electron.Session, host?: string, port?: string) => { export const setProxy = () => { if (!browserWindow) return const proxy = getProxy() - setSesProxy(browserWindow.webContents.session, proxy?.host, String(proxy?.port)) + setSesProxy(browserWindow.webContents.session, proxy?.host, proxy?.port) }