User Card Content fixes and updates
This commit is contained in:
parent
0ad837846a
commit
fa8ecb1c39
3 changed files with 109 additions and 56 deletions
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue