mark single notifs as seen properly on server
This commit is contained in:
parent
406fdd8ede
commit
75519223f9
4 changed files with 22 additions and 6 deletions
|
@ -525,6 +525,10 @@ export const mutations = {
|
|||
notification.seen = true
|
||||
})
|
||||
},
|
||||
markSingleNotificationAsSeen (state, { id }) {
|
||||
const notification = find(state.notifications.data, n => n.id === id)
|
||||
if (notification) notification.seen = true
|
||||
},
|
||||
dismissNotification (state, { id }) {
|
||||
state.notifications.data = state.notifications.data.filter(n => n.id !== id)
|
||||
},
|
||||
|
@ -691,6 +695,14 @@ const statuses = {
|
|||
credentials: rootState.users.currentUser.credentials
|
||||
})
|
||||
},
|
||||
markSingleNotificationAsSeen ({ rootState, commit }, { id }) {
|
||||
commit('markSingleNotificationAsSeen', { id })
|
||||
apiService.markNotificationsAsSeen({
|
||||
single: true,
|
||||
id,
|
||||
credentials: rootState.users.currentUser.credentials
|
||||
})
|
||||
},
|
||||
dismissNotification ({ rootState, commit }, { id }) {
|
||||
rootState.api.backendInteractor.dismissNotification({ id })
|
||||
.then(() => commit('dismissNotification', { id }))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue