Skip to content

Commit 6598313

Browse files
committed
Add dev console to auth window
1 parent f97ca23 commit 6598313

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

controllers/auth.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const electron = require('electron');
2+
const localShortcut = require('electron-localshortcut');
23
const EventEmitter = require('events').EventEmitter;
34

45
const { BrowserWindow } = electron;
@@ -41,12 +42,24 @@ const AuthWindows = {
4142
this.authWindow = new BrowserWindow(this.windowProps);
4243
if (this.authWindow) {
4344
this.loadAuthPage();
45+
this.configureLocalShortcut();
4446
this.bindEventListener();
4547
} else {
4648
console.error('Problem creating auth window');
4749
}
4850
},
4951

52+
configureLocalShortcut: function configureLocalShortcut() {
53+
const windowToRegister = this.authWindow;
54+
55+
// Development only shortcut
56+
if (process.env.NODE_ENV === 'development') {
57+
localShortcut.register(windowToRegister, 'CommandOrControl+Shift+I', () => {
58+
this.authWindow.toggleDevTools();
59+
});
60+
}
61+
},
62+
5063
bindEventListener: function bindEventListener() {
5164
const self = this;
5265
this.authWindow.once('ready-to-show', () => {

0 commit comments

Comments
 (0)