[client-app] don't re-close dev tools

Summary:
If you have the console open and are looking at the Source panel or
something, this will constantly bring you back to the Console panel. Won't
do that anymore with this chec

Test Plan: manual

Reviewers: spang, mark, halla, juan

Reviewed By: mark, halla, juan

Differential Revision: https://phab.nylas.com/D4162
This commit is contained in:
Evan Morikawa 2017-03-09 15:14:16 -05:00
parent 3e895c74c9
commit 3c8925ef76

View file

@ -333,8 +333,10 @@ export default class NylasEnvConstructor {
if (this.inSpecMode()) { if (this.inSpecMode()) {
jasmine.getEnv().currentSpec.fail(error); jasmine.getEnv().currentSpec.fail(error);
} else if (this.inDevMode() && !noWindows) { } else if (this.inDevMode() && !noWindows) {
this.openDevTools(); if (!this.isDevToolsOpened()) {
this.executeJavaScriptInDevTools("DevToolsAPI.showPanel('console')"); this.openDevTools();
this.executeJavaScriptInDevTools("DevToolsAPI.showPanel('console')");
}
} }
this.errorLogger.reportError(error, extra); this.errorLogger.reportError(error, extra);
@ -999,6 +1001,10 @@ export default class NylasEnvConstructor {
return ipcRenderer.send('call-webcontents-method', 'openDevTools'); 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. // Extended: Toggle the visibility of the dev tools for the current window.
toggleDevTools() { toggleDevTools() {
return ipcRenderer.send('call-webcontents-method', 'toggleDevTools'); return ipcRenderer.send('call-webcontents-method', 'toggleDevTools');