optimize if blocks
This commit is contained in:
parent
1bcd430884
commit
f76702bb44
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue