1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-24 11:55:50 +01:00

fixes for macos

This commit is contained in:
Kyle Spearrin 2018-05-05 11:36:36 -04:00
parent 9d969929de
commit b8ae738621
2 changed files with 8 additions and 4 deletions

View File

@ -1046,5 +1046,9 @@
},
"exit": {
"message": "Exit"
},
"showHide": {
"message": "Show / Hide",
"description": "Text for a button that toggles the visibility of the window. Shows the window when it is hidden or hides the window if it is currently open."
}
}

View File

@ -35,12 +35,12 @@ export class TrayMain {
async init(additionalMenuItems: MenuItemConstructorOptions[] = null) {
const menuItemOptions: MenuItemConstructorOptions[] = [{
label: this.appName,
label: this.i18nService.t('showHide'),
click: () => this.toggleWindow(),
},
{ type: 'separator' },
{
label: this.i18nService.t('exit'),
label: process.platform === 'darwin' ? this.i18nService.t('close') : this.i18nService.t('exit'),
click: () => this.closeWindow(),
}];
@ -56,14 +56,14 @@ export class TrayMain {
this.windowMain.win.on('minimize', async (e: Event) => {
if (await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey)) {
e.preventDefault();
await this.hideToTray();
this.hideToTray();
}
});
this.windowMain.win.on('show', async (e: Event) => {
const enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);
if (!enableTray) {
await this.removeTray(false);
this.removeTray(false);
}
});
}