diff --git a/packages/client-app/src/nylas-env.es6 b/packages/client-app/src/nylas-env.es6 index bfac849cb..f33949c92 100644 --- a/packages/client-app/src/nylas-env.es6 +++ b/packages/client-app/src/nylas-env.es6 @@ -333,8 +333,10 @@ export default class NylasEnvConstructor { if (this.inSpecMode()) { jasmine.getEnv().currentSpec.fail(error); } else if (this.inDevMode() && !noWindows) { - this.openDevTools(); - this.executeJavaScriptInDevTools("DevToolsAPI.showPanel('console')"); + if (!this.isDevToolsOpened()) { + this.openDevTools(); + this.executeJavaScriptInDevTools("DevToolsAPI.showPanel('console')"); + } } this.errorLogger.reportError(error, extra); @@ -999,6 +1001,10 @@ export default class NylasEnvConstructor { return ipcRenderer.send('call-webcontents-method', 'openDevTools'); } + isDevToolsOpened() { + return this.getCurrentWindow().webContents.isDevToolsOpened() + } + // Extended: Toggle the visibility of the dev tools for the current window. toggleDevTools() { return ipcRenderer.send('call-webcontents-method', 'toggleDevTools');