Skip to content

Commit 612d146

Browse files
committed
Disable menu bar and debug console
1 parent 33afbf8 commit 612d146

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const createWindow = async (): Promise<void> => {
7575
const mainWindow = new BrowserWindow({
7676
height: 600,
7777
width: 800,
78+
autoHideMenuBar: true,
7879
webPreferences: {
7980
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
8081
},
@@ -92,8 +93,10 @@ const createWindow = async (): Promise<void> => {
9293
logMain('Loading main window URL', { url: startUrl });
9394
mainWindow.loadURL(startUrl);
9495

95-
// Open the DevTools (optional; comment out in production).
96-
mainWindow.webContents.openDevTools();
96+
// Open the DevTools only in development mode
97+
if (process.env.NODE_ENV === 'development' || !app.isPackaged) {
98+
mainWindow.webContents.openDevTools();
99+
}
97100
};
98101

99102
// This method will be called when Electron has finished
@@ -158,7 +161,7 @@ app.on('before-quit', async (event) => {
158161
await Promise.all(cleanupPromises);
159162
logMain('All P2PCF cleanups complete, waiting 5 seconds before quit to allow DELETE request to complete');
160163

161-
// Wait 5 seconds to allow P2PCF DELETE request to complete
164+
// Wait 3 seconds to allow P2PCF DELETE request to complete
162165
await new Promise((resolve) => setTimeout(resolve, 3000));
163166

164167
logMain('Timeout complete, quitting app now');

0 commit comments

Comments
 (0)