Show badges for unread announcements
This commit is contained in:
parent
fe1d01ec9a
commit
b4a7e58bec
8 changed files with 23 additions and 7 deletions
|
|
@ -25,9 +25,18 @@ export const mutations = {
|
|||
}
|
||||
}
|
||||
|
||||
export const getters = {
|
||||
unreadAnnouncementCount (state) {
|
||||
return state.announcements.reduce((acc, cur) => {
|
||||
return (!cur.inactive && !cur.read) ? acc + 1 : acc
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
const announcements = {
|
||||
state: defaultState,
|
||||
mutations,
|
||||
getters,
|
||||
actions: {
|
||||
fetchAnnouncements (store) {
|
||||
const currentUser = store.rootState.users.currentUser
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue