Only open devtools on startup in dev mode

This commit is contained in:
Quinten Kock 2025-11-10 03:40:43 +01:00
parent 0dd9ddc5b4
commit 6e09e25b2b
1 changed files with 3 additions and 3 deletions

View File

@ -28,6 +28,9 @@ const createWindow = () => {
// and load the index.html of the app.
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
// Open the DevTools only in dev mode
mainWindow.webContents.openDevTools();
} else {
mainWindow.loadFile(
path.join(
@ -36,9 +39,6 @@ const createWindow = () => {
),
);
}
// Open the DevTools.
mainWindow.webContents.openDevTools();
};
// This method will be called when Electron has finished