mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-12 13:39:14 +01:00
MacOS: Closing with red button won't open window again through tray icon (#40)
* Fixed issue on MacOS where closing BW via the red button then reopening using tray icon wouldn't work * Added MacOS only condition to the window recreation of the toggleWindow method. Made createWindow public in WindowMain.
This commit is contained in:
parent
741e060d99
commit
1bcd430884
@ -121,16 +121,21 @@ export class TrayMain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private toggleWindow() {
|
private toggleWindow() {
|
||||||
if (this.windowMain.win == null) {
|
if (this.windowMain.win === null) {
|
||||||
return;
|
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 {
|
||||||
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;
|
||||||
|
@ -81,7 +81,7 @@ export class WindowMain {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async createWindow() {
|
async createWindow(): Promise<void> {
|
||||||
this.windowStates[Keys.mainWindowSize] = await this.getWindowState(Keys.mainWindowSize, this.defaultWidth,
|
this.windowStates[Keys.mainWindowSize] = await this.getWindowState(Keys.mainWindowSize, this.defaultWidth,
|
||||||
this.defaultHeight);
|
this.defaultHeight);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user