diff --git a/src/components/navigation/navigation.js b/src/components/navigation/navigation.js index 41685cda..c3071c8c 100644 --- a/src/components/navigation/navigation.js +++ b/src/components/navigation/navigation.js @@ -82,7 +82,8 @@ export const ROOT_ITEMS = { drafts: { route: 'drafts', icon: 'file-pen', - label: 'nav.drafts' + label: 'nav.drafts', + badgeGetter: 'draftCount' } } diff --git a/src/modules/drafts.js b/src/modules/drafts.js index 808e6837..01eb3dcf 100644 --- a/src/modules/drafts.js +++ b/src/modules/drafts.js @@ -31,6 +31,9 @@ export const getters = { }, draftsArray (state) { return Object.values(state.drafts) + }, + draftCount (state) { + return Object.values(state.drafts).length } }