mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00: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:
committed by
Kyle Spearrin
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user