add sort on in appList and fix appLabel function
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Simon Vieille 2022-12-27 07:02:07 +01:00
parent 15ac74d8e9
commit 7a43ca2c75
Signed by: deblan
GPG Key ID: 579388D585F70417
1 changed files with 10 additions and 3 deletions

View File

@ -53,6 +53,7 @@
:aria-label="appLabel(app)"
:aria-current="app.active ? 'page' : false"
:href="app.href"
:style="makeStyle(app)"
class="app-menu-popover-entry">
<template #icon>
<div class="app-icon" :class="{ 'has-unread': app.unread > 0 }">
@ -110,13 +111,19 @@ export default {
this.observer.disconnect()
},
methods: {
appLabel() {
return (app) => app.name
appLabel(app) {
return app.name
+ (app.active ? ' (' + t('core', 'Currently open') + ')' : '')
+ (app.unread > 0 ? ' (' + n('core', '{count} notification', '{count} notifications', app.unread, { count: app.unread }) + ')' : '')
},
appList() {
return Object.values(this.apps)
let items = Object.values(this.apps)
items.sort((a, b) => {
return a.order < b.order ? -1 : 1;
})
return items
},
mainAppList() {
return this.appList().slice(0, this.appLimit)