mirror of
https://github.com/bitwarden/browser
synced 2025-01-28 03:59:50 +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,14 +121,19 @@ export class TrayMain {
|
||||
}
|
||||
|
||||
private toggleWindow() {
|
||||
if (this.windowMain.win == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.windowMain.win.isVisible()) {
|
||||
this.windowMain.win.hide();
|
||||
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 {
|
||||
this.windowMain.win.show();
|
||||
if (this.windowMain.win.isVisible()) {
|
||||
this.windowMain.win.hide();
|
||||
} else {
|
||||
this.windowMain.win.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.defaultHeight);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user