logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/
commit: 71f16ec39c2ae1e5c4d2a842f894f2469dfa5079
parent 1bffcc5fe71ac3eac1d3e343523df18ee825eaae
Author: tusooa <tusooa@kazv.moe>
Date:   Fri, 10 Mar 2023 20:22:41 -0500

Add draft count to nav panel

Diffstat:

Msrc/components/navigation/navigation.js3++-
Msrc/modules/drafts.js3+++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 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 @@ -31,6 +31,9 @@ export const getters = { }, draftsArray (state) { return Object.values(state.drafts) + }, + draftCount (state) { + return Object.values(state.drafts).length } }