From 232f2f4310da949d9b8e33d7c5f3d71309d547b3 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford Date: Mon, 5 Aug 2019 14:57:29 -0700 Subject: [PATCH] fix "about" window in dev mode --- src/main/index.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 4628fbf..949c9aa 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -42,16 +42,22 @@ const createWindow = ({search = null, url = 'index.html', ...browserWindowOption }); }); - if (isDevelopment) { - window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}/${url}`); - } else { - window.loadURL(formatUrl({ + const fullUrl = formatUrl(isDevelopment ? + { // Webpack Dev Server + hostname: 'localhost', + pathname: url, + port: process.env.ELECTRON_WEBPACK_WDS_PORT, + protocol: 'http', + search, + slashes: true + } : { // production / bundled pathname: path.join(__dirname, url), protocol: 'file', search, slashes: true - })); - } + } + ); + window.loadURL(fullUrl); return window; };