revert removeStatus changes

This commit is contained in:
taehoon 2019-04-24 21:49:44 -04:00
parent 1229622fed
commit 8308315038

View file

@ -364,19 +364,15 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
})
}
const removeStatus = (state, { timeline, userId, statusId }) => {
const removeStatus = (state, { timeline, userId }) => {
const timelineObject = state.timelines[timeline]
const status = userId ? { user: { id: userId } } : { id: statusId }
remove(timelineObject.statuses, status)
remove(timelineObject.visibleStatuses, status)
if (statusId) {
delete timelineObject.statusesObject[statusId]
delete timelineObject.visibleStatusesObject[statusId]
sortTimeline(timelineObject)
}
if (userId) {
remove(timelineObject.statuses, { user: { id: userId } })
remove(timelineObject.visibleStatuses, { user: { id: userId } })
timelineObject.minVisibleId = timelineObject.visibleStatuses.length > 0 ? last(timelineObject.visibleStatuses).id : 0
timelineObject.maxId = timelineObject.statuses.length > 0 ? first(timelineObject.statuses).id : 0
}
}
export const mutations = {
addNewStatuses,