Skip to content

Commit 232f2f4

Browse files
author
Christopher Willis-Ford
committed
fix "about" window in dev mode
1 parent 8b2cdb0 commit 232f2f4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/main/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,22 @@ const createWindow = ({search = null, url = 'index.html', ...browserWindowOption
4242
});
4343
});
4444

45-
if (isDevelopment) {
46-
window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}/${url}`);
47-
} else {
48-
window.loadURL(formatUrl({
45+
const fullUrl = formatUrl(isDevelopment ?
46+
{ // Webpack Dev Server
47+
hostname: 'localhost',
48+
pathname: url,
49+
port: process.env.ELECTRON_WEBPACK_WDS_PORT,
50+
protocol: 'http',
51+
search,
52+
slashes: true
53+
} : { // production / bundled
4954
pathname: path.join(__dirname, url),
5055
protocol: 'file',
5156
search,
5257
slashes: true
53-
}));
54-
}
58+
}
59+
);
60+
window.loadURL(fullUrl);
5561

5662
return window;
5763
};

0 commit comments

Comments
 (0)