Skip to content

Commit

Permalink
Add support for devtools via env var (#139)
Browse files Browse the repository at this point in the history
* Add support for devtools via env var

* Update createMenu.ts
  • Loading branch information
masad-frost authored Oct 19, 2023
1 parent 0e3702e commit 5ef2f49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/createMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export function createDockMenu(): Menu {
return menu;
}

const allowDevtools = !isProduction || process.env.ENABLE_DEVTOOLS;

export function createApplicationMenu(): Menu {
const template = [];

Expand Down Expand Up @@ -95,7 +97,6 @@ export function createApplicationMenu(): Menu {
const devOnlyMenuItems = [
{ role: 'reload' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
];

Expand All @@ -104,6 +105,7 @@ export function createApplicationMenu(): Menu {
label: 'View',
submenu: [
...(!isProduction ? devOnlyMenuItems : []),
...(allowDevtools ? [{ role: 'toggleDevTools' }] : []),
{ role: 'togglefullscreen' },
],
});
Expand Down

0 comments on commit 5ef2f49

Please sign in to comment.