1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

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

This commit is contained in:
Kyle Spearrin
2018-05-07 12:15:12 -04:00
2 changed files with 8 additions and 4 deletions

View File

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