From b2ef751adab1334b6de60663117b1190b3ce3c74 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: Thu, 3 Nov 2022 09:07:24 +0800 Subject: [PATCH] fix(#298): use VITE_DEV_SERVER_URL instead `app.isPackaged` --- electron/main/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 7e5a9a5..2114d75 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -52,12 +52,12 @@ async function createWindow() { }, }) - if (app.isPackaged) { - win.loadFile(indexHtml) - } else { + if (process.env.VITE_DEV_SERVER_URL) { // #298 win.loadURL(url) // Open devTool if the app is not packaged win.webContents.openDevTools() + } else { + win.loadFile(indexHtml) } // Test actively push message to the Electron-Renderer