diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-05-02 10:52:57 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-05-02 10:52:57 +0300 |
| commit | 75519223f9a715aacb99d3780ee681089a479292 (patch) | |
| tree | 32f0810da5ecd92ecf7b60ef7a44729ee74ec408 /src/modules/statuses.js | |
| parent | 406fdd8edec210d14589e0ff684a166250236779 (diff) | |
mark single notifs as seen properly on server
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 239f41eb..2a8b9581 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -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 })) |
