Skip to content

Commit 5e73536

Browse files
committed
Open dev tools only when developing
1 parent e0105bb commit 5e73536

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

packages/main/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,14 @@ let mainWin: BrowserWindow | null = null;
2626
const createWindow = () => {
2727
Store.initRenderer();
2828

29-
console.log(app.getPath('userData'));
30-
3129
mainWin = new BrowserWindow({
3230
title: 'Main window',
3331
webPreferences: {
3432
nodeIntegration: true,
3533
contextIsolation: false,
3634
webSecurity: false,
3735
nodeIntegrationInWorker: true,
38-
// devTools: !app.isPackaged,
39-
devTools: true,
36+
devTools: !app.isPackaged,
4037
},
4138
resizable: true,
4239
width: 1000,
@@ -46,10 +43,12 @@ const createWindow = () => {
4643

4744
mainWin.setMenu(null);
4845

49-
mainWin.webContents.openDevTools({
50-
mode: 'undocked',
51-
activate: true,
52-
});
46+
if (!app.isPackaged) {
47+
mainWin.webContents.openDevTools({
48+
mode: 'undocked',
49+
activate: true,
50+
});
51+
}
5352

5453
if (app.isPackaged) {
5554
mainWin.loadFile(join(__dirname, '../renderer/index.html'));

0 commit comments

Comments
 (0)