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() {
|
||||
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();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
if (this.windowMain.win.isVisible()) {
|
||||
this.windowMain.win.hide();
|
||||
} else {
|
||||
this.windowMain.win.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private closeWindow() {
|
||||
this.windowMain.isQuitting = true;
|
||||
|
||||
Reference in New Issue
Block a user