diff options
author | 2017-11-19 00:32:01 +0100 | |
---|---|---|
committer | 2017-11-19 00:32:01 +0100 | |
commit | f5d6d03451f167c78e6a72df9f66f0425a7eb27e (patch) | |
tree | 1d3dbfd40a798db7c8cc4d0581705d9fee8e9168 /src/lib/Menu.js | |
parent | Merge pull request #294 from meetfranz/feature/192-display-disabled-services (diff) | |
parent | Remove unused menu config (diff) | |
download | ferdium-app-f5d6d03451f167c78e6a72df9f66f0425a7eb27e.tar.gz ferdium-app-f5d6d03451f167c78e6a72df9f66f0425a7eb27e.tar.zst ferdium-app-f5d6d03451f167c78e6a72df9f66f0425a7eb27e.zip |
Merge pull request #301 from meetfranz/feature/250-service-menu
[PR] Fix empty strings in service menu
Diffstat (limited to 'src/lib/Menu.js')
-rw-r--r-- | src/lib/Menu.js | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 8f0a92c3d..6624ab75e 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -214,30 +214,6 @@ export default class FranzMenu { | |||
214 | ], | 214 | ], |
215 | }, | 215 | }, |
216 | ); | 216 | ); |
217 | // Window menu. | ||
218 | tpl[3].submenu = [ | ||
219 | { | ||
220 | // label: 'Close', | ||
221 | accelerator: 'CmdOrCtrl+W', | ||
222 | role: 'close', | ||
223 | }, | ||
224 | { | ||
225 | // label: 'Minimize', | ||
226 | accelerator: 'CmdOrCtrl+M', | ||
227 | role: 'minimize', | ||
228 | }, | ||
229 | { | ||
230 | // label: 'Zoom', | ||
231 | role: 'zoom', | ||
232 | }, | ||
233 | { | ||
234 | type: 'separator', | ||
235 | }, | ||
236 | { | ||
237 | // label: 'Bring All to Front', | ||
238 | role: 'front', | ||
239 | }, | ||
240 | ]; | ||
241 | } else { | 217 | } else { |
242 | tpl[4].submenu.unshift({ | 218 | tpl[4].submenu.unshift({ |
243 | role: 'about', | 219 | role: 'about', |
@@ -277,7 +253,7 @@ export default class FranzMenu { | |||
277 | 253 | ||
278 | if (this.stores.user.isLoggedIn) { | 254 | if (this.stores.user.isLoggedIn) { |
279 | return services.map((service, i) => ({ | 255 | return services.map((service, i) => ({ |
280 | label: service.name, | 256 | label: this._getServiceName(service), |
281 | accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null, | 257 | accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null, |
282 | type: 'radio', | 258 | type: 'radio', |
283 | checked: service.isActive, | 259 | checked: service.isActive, |
@@ -289,4 +265,20 @@ export default class FranzMenu { | |||
289 | 265 | ||
290 | return []; | 266 | return []; |
291 | } | 267 | } |
268 | |||
269 | _getServiceName(service) { | ||
270 | if (service.name) { | ||
271 | return service.name; | ||
272 | } | ||
273 | |||
274 | let name = service.recipe.name; | ||
275 | |||
276 | if (service.team) { | ||
277 | name = `${name} (${service.team})`; | ||
278 | } else if (service.customUrl) { | ||
279 | name = `${name} (${service.customUrl})`; | ||
280 | } | ||
281 | |||
282 | return name; | ||
283 | } | ||
292 | } | 284 | } |