Fix menu separators (#1220)

* Fix separators appearing when they shouldn't

* Use const instead of let
This commit is contained in:
Daniel James Smith 2022-01-07 15:54:35 +01:00 committed by GitHub
parent 695e8389d8
commit d64b00977c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 16 deletions

View File

@ -16,22 +16,33 @@ export class BitwardenMenu implements IMenubarMenu {
readonly label: string = "Bitwarden";
get items(): MenuItemConstructorOptions[] {
return [
this.aboutBitwarden,
this.checkForUpdates,
this.separator,
this.settings,
this.lock,
this.lockAll,
this.logOut,
this.services,
this.separator,
this.hideBitwarden,
this.hideOthers,
this.showAll,
this.separator,
this.quitBitwarden,
];
const items = [this.aboutBitwarden, this.checkForUpdates];
if (this.aboutBitwarden.visible === true || this.checkForUpdates.visible === true) {
items.push(this.separator);
}
items.push(this.settings);
items.push(this.lock);
items.push(this.lockAll);
items.push(this.logOut);
items.push(this.services);
if (
this.hideBitwarden.visible === true ||
this.hideOthers.visible === true ||
this.showAll.visible === true
) {
items.push(this.separator);
}
items.push(this.hideBitwarden);
items.push(this.hideOthers);
items.push(this.showAll);
if (this.quitBitwarden.visible === true) {
items.push(this.separator);
}
items.push(this.quitBitwarden);
return items;
}
private readonly _i18nService: I18nService;

View File

@ -16,6 +16,10 @@ export class WindowMenu implements IMenubarMenu {
}
get items(): MenuItemConstructorOptions[] {
if (!isMacAppStore()) {
return [this.hideToMenu, this.alwaysOnTop];
}
return [
this.minimize,
this.hideToMenu,