Skip to content

Commit

Permalink
Fix folderStats
Browse files Browse the repository at this point in the history
Signed-off-by: GretaD <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Feb 4, 2020
1 parent eac3095 commit 644afe9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/components/NavigationFolder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import ActionText from '@nextcloud/vue/dist/Components/ActionText'
import {getFolderStats} from '../service/FolderService'
import logger from '../logger'
import {translatePlural as n} from '@nextcloud/l10n'
import {translate as translateMailboxName} from '../l10n/MailboxTranslator'
export default {
Expand Down Expand Up @@ -132,14 +133,20 @@ export default {
statsText() {
if (this.folderStats && 'total' in this.folderStats && 'unread' in this.folderStats) {
if (this.folderStats.unread === 0) {
return n('mail', '{total} message', '{total} messages', {
return n('mail', '{total} message', '{total} messages', this.folderStats.total, {
total: this.folderStats.total,
})
} else {
return n('mail', '{unread} unread of {total}', '{unread} unread of {total}', {
total: this.folderStats.total,
unread: this.folderStats.unread,
})
return n(
'mail',
'{unread} unread of {total}',
'{unread} unread of {total}',
this.folderStats.unread,
{
total: this.folderStats.total,
unread: this.folderStats.unread,
}
)
}
}
return t('mail', 'Loading …')
Expand Down

0 comments on commit 644afe9

Please sign in to comment.