Permalink
Browse files

fix(Menu): Add fallback to service menu when service name is empty

Closes #250
  • Loading branch information...
adlk committed Nov 18, 2017
1 parent 8736c15 commit 42ed24d5fd3586537f94f52bfc0b287a5fdbe6ea
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/lib/Menu.js
@@ -277,7 +277,7 @@ export default class FranzMenu {
if (this.stores.user.isLoggedIn) {
return services.map((service, i) => ({
label: service.name,
label: this._getServiceName(service),
accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null,
type: 'radio',
checked: service.isActive,
@@ -289,4 +289,20 @@ export default class FranzMenu {
return [];
}
_getServiceName(service) {
if (service.name) {
return service.name;
}
let name = service.recipe.name;
if (service.team) {
name = `${name} (${service.team})`;
} else if (service.customUrl) {
name = `${name} (${service.customUrl})`;
}
return name;
}
}

0 comments on commit 42ed24d

Please sign in to comment.