mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
[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:
parent
3e895c74c9
commit
3c8925ef76
1 changed files with 8 additions and 2 deletions
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue