Skip to content

Commit

Permalink
chore: automatically open devtools on local development (#1324)
Browse files Browse the repository at this point in the history
* chore: automatically open devtools on local development

* docs: add reload app note

* chore: revert `main.js` changes

* chore: remove node_env

* chore: add reload and toggleDevTools buttons
  • Loading branch information
afonsojramos authored Jul 2, 2024
1 parent 1d10aef commit 81e027e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ To run the **electron app**:
pnpm start
```

To reload the app with the changes that `pnpm watch` has detected, you can use the `CmdOrCtrl+R` shortcut.

### Tests

There are 2 checks:
Expand Down
8 changes: 8 additions & 0 deletions src/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ const browserWindowOpts = {
};

const contextMenu = Menu.buildFromTemplate([
{
role: 'reload',
},
{
role: 'toggleDevTools',
},
{ type: 'separator' },
{
label: 'Quit',
click: () => {
Expand Down Expand Up @@ -80,6 +87,7 @@ app.whenReady().then(async () => {
mb.window.setSize(800, 600);
mb.window.center();
mb.window.resizable = true;
mb.window.setAlwaysOnTop(true);
});

mb.window.webContents.on('devtools-closed', () => {
Expand Down

0 comments on commit 81e027e

Please sign in to comment.