diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-05-02 10:52:57 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-05-02 16:21:46 +0300 |
| commit | 20b53d58b753075bb1bda49d0595eba02ed5f755 (patch) | |
| tree | 3618f5ff455bfefe0507557cf5d0fe2eda8e504d /src/modules/statuses.js | |
| parent | 36dcfa8cc1315be65a47c041a8c926ff961b3ae4 (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 })) |
