From c9d3452f051a4bfa7b2122a48d300efeac8a15b6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 15 Mar 2018 13:00:08 -0400 Subject: [PATCH] no update menu item for windows store --- src/main/menu.main.ts | 58 ++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/main/menu.main.ts b/src/main/menu.main.ts index 667abef75a1..ed3aba3016e 100644 --- a/src/main/menu.main.ts +++ b/src/main/menu.main.ts @@ -11,7 +11,7 @@ import { } from 'electron'; import { Main } from '../main'; -import { isMacAppStore } from '../scripts/utils'; +import { isMacAppStore, isWindowsStore } from '../scripts/utils'; import { ConstantsService } from 'jslib/services/constants.service'; @@ -584,32 +584,38 @@ export class MenuMain { firstMenuOptions); // About menu + const aboutMenuAdditions: MenuItemConstructorOptions[] = [ + { type: 'separator' }, + ]; + + if (!isWindowsStore()) { + aboutMenuAdditions.push(updateMenuItem); + } + + aboutMenuAdditions.push({ + label: this.main.i18nService.t('aboutBitwarden'), + click: () => { + const aboutInformation = this.main.i18nService.t('version', app.getVersion()) + + '\nShell ' + process.versions.electron + + '\nRenderer ' + process.versions.chrome + + '\nNode ' + process.versions.node + + '\nArchitecture ' + process.arch; + const result = dialog.showMessageBox(this.main.windowMain.win, { + title: 'Bitwarden', + message: 'Bitwarden', + detail: aboutInformation, + type: 'info', + noLink: true, + buttons: [this.main.i18nService.t('ok'), this.main.i18nService.t('copy')], + }); + if (result === 1) { + clipboard.writeText(aboutInformation); + } + }, + }); + template[template.length - 1].submenu = - (template[template.length - 1].submenu as MenuItemConstructorOptions[]).concat([ - { type: 'separator' }, - updateMenuItem, - { - label: this.main.i18nService.t('aboutBitwarden'), - click: () => { - const aboutInformation = this.main.i18nService.t('version', app.getVersion()) + - '\nShell ' + process.versions.electron + - '\nRenderer ' + process.versions.chrome + - '\nNode ' + process.versions.node + - '\nArchitecture ' + process.arch; - const result = dialog.showMessageBox(this.main.windowMain.win, { - title: 'Bitwarden', - message: 'Bitwarden', - detail: aboutInformation, - type: 'info', - noLink: true, - buttons: [this.main.i18nService.t('ok'), this.main.i18nService.t('copy')], - }); - if (result === 1) { - clipboard.writeText(aboutInformation); - } - }, - }, - ]); + (template[template.length - 1].submenu as MenuItemConstructorOptions[]).concat(aboutMenuAdditions); } this.menu = Menu.buildFromTemplate(template);