diff options
| author | HJ <spam@hjkos.com> | 2018-12-26 09:19:25 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2018-12-26 09:19:25 +0000 |
| commit | fa8ecb1c39d2900de69fef0a609ef31ce0ef9161 (patch) | |
| tree | 1ab3a10513f54a7ed7f4c7333ba0519ed9419be1 /src/modules/users.js | |
| parent | 0ad837846a3b833203bdae68fc6d3cb37c257c4b (diff) | |
User Card Content fixes and updates
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index f2b59aaa..666811b5 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -66,6 +66,9 @@ export const mutations = { setUserForStatus (state, status) { status.user = state.usersObject[status.user.id] }, + setUserForNotification (state, notification) { + notification.action.user = state.usersObject[notification.action.user.id] + }, setColor (state, { user: { id }, highlighted }) { const user = state.usersObject[id] set(user, 'highlight', highlighted) @@ -136,6 +139,21 @@ const users = { store.commit('setUserForStatus', status) }) }, + addNewNotifications (store, { notifications }) { + const users = compact(map(notifications, 'from_profile')) + const notificationIds = compact(notifications.map(_ => String(_.id))) + store.commit('addNewUsers', users) + + const notificationsObject = store.rootState.statuses.notifications.idStore + const relevantNotifications = Object.entries(notificationsObject) + .filter(([k, val]) => notificationIds.includes(k)) + .map(([k, val]) => val) + + // Reconnect users to notifications + each(relevantNotifications, (notification) => { + store.commit('setUserForNotification', notification) + }) + }, async signUp (store, userInfo) { store.commit('signUpPending') |
