Merge branch 'master' of github.com:bitwarden/desktop

This commit is contained in:
Kyle Spearrin 2018-05-07 12:15:12 -04:00
commit f2b87edb83
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);
}
});
}