Add draft count to nav panel

This commit is contained in:
tusooa 2023-03-10 20:22:41 -05:00
parent 3c828f3575
commit 19b5bb06a0
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
2 changed files with 5 additions and 1 deletions

View File

@ -82,7 +82,8 @@ export const ROOT_ITEMS = {
drafts: {
route: 'drafts',
icon: 'file-pen',
label: 'nav.drafts'
label: 'nav.drafts',
badgeGetter: 'draftCount'
}
}

View File

@ -31,6 +31,9 @@ export const getters = {
},
draftsArray (state) {
return Object.values(state.drafts)
},
draftCount (state) {
return Object.values(state.drafts).length
}
}