mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
optimize if blocks
This commit is contained in:
@@ -121,21 +121,21 @@ export class TrayMain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private toggleWindow() {
|
private toggleWindow() {
|
||||||
if (this.windowMain.win === null) {
|
if (this.windowMain.win == null) {
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
// On MacOS, closing the window via the red button destroys the BrowserWindow instance.
|
// On MacOS, closing the window via the red button destroys the BrowserWindow instance.
|
||||||
this.windowMain.createWindow().then(() => {
|
this.windowMain.createWindow().then(() => {
|
||||||
this.windowMain.win.show();
|
this.windowMain.win.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
if (this.windowMain.win.isVisible()) {
|
if (this.windowMain.win.isVisible()) {
|
||||||
this.windowMain.win.hide();
|
this.windowMain.win.hide();
|
||||||
} else {
|
} else {
|
||||||
this.windowMain.win.show();
|
this.windowMain.win.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private closeWindow() {
|
private closeWindow() {
|
||||||
this.windowMain.isQuitting = true;
|
this.windowMain.isQuitting = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user