Skip to content

Commit 81e027e

Browse files
authored
chore: automatically open devtools on local development (#1324)
* 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
1 parent 1d10aef commit 81e027e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ To run the **electron app**:
3030
pnpm start
3131
```
3232

33+
To reload the app with the changes that `pnpm watch` has detected, you can use the `CmdOrCtrl+R` shortcut.
34+
3335
### Tests
3436

3537
There are 2 checks:

src/electron/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ const browserWindowOpts = {
3434
};
3535

3636
const contextMenu = Menu.buildFromTemplate([
37+
{
38+
role: 'reload',
39+
},
40+
{
41+
role: 'toggleDevTools',
42+
},
43+
{ type: 'separator' },
3744
{
3845
label: 'Quit',
3946
click: () => {
@@ -80,6 +87,7 @@ app.whenReady().then(async () => {
8087
mb.window.setSize(800, 600);
8188
mb.window.center();
8289
mb.window.resizable = true;
90+
mb.window.setAlwaysOnTop(true);
8391
});
8492

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

0 commit comments

Comments
 (0)