1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-02 08:40:08 +01:00

optimize if blocks

This commit is contained in:
Kyle Spearrin 2019-05-15 22:47:58 -04:00
parent 1bcd430884
commit f76702bb44

View File

@ -121,19 +121,19 @@ export class TrayMain {
}
private toggleWindow() {
if (this.windowMain.win === null) {
if (this.windowMain.win == null) {
if (process.platform === 'darwin') {
// On MacOS, closing the window via the red button destroys the BrowserWindow instance.
this.windowMain.createWindow().then(() => {
this.windowMain.win.show();
});
}
return;
}
if (this.windowMain.win.isVisible()) {
this.windowMain.win.hide();
} else {
if (this.windowMain.win.isVisible()) {
this.windowMain.win.hide();
} else {
this.windowMain.win.show();
}
this.windowMain.win.show();
}
}