File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11const electron = require ( 'electron' ) ;
2+ const localShortcut = require ( 'electron-localshortcut' ) ;
23const EventEmitter = require ( 'events' ) . EventEmitter ;
34
45const { 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' , ( ) => {
You can’t perform that action at this time.
0 commit comments