From a9240837be52b9033cd8f20ee61d8985f4615ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Tue, 22 Nov 2022 08:15:04 +0800 Subject: [PATCH] chore: VITE_DEV_SERVER_URL instead `app.isPackaged` --- electron/main/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index f45bd76..8f0c0f7 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -98,10 +98,9 @@ ipcMain.handle('open-win', (event, arg) => { }, }) - if (app.isPackaged) { - childWindow.loadFile(indexHtml, { hash: arg }) - } else { + if (process.env.VITE_DEV_SERVER_URL) { childWindow.loadURL(`${url}#${arg}`) - // childWindow.webContents.openDevTools({ mode: "undocked", activate: true }) + } else { + childWindow.loadFile(indexHtml, { hash: arg }) } })