forked from AkkomaGang/akkoma-fe
revert removeStatus changes
This commit is contained in:
parent
1229622fed
commit
8308315038
1 changed files with 6 additions and 10 deletions
|
@ -364,18 +364,14 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const removeStatus = (state, { timeline, userId, statusId }) => {
|
const removeStatus = (state, { timeline, userId }) => {
|
||||||
const timelineObject = state.timelines[timeline]
|
const timelineObject = state.timelines[timeline]
|
||||||
const status = userId ? { user: { id: userId } } : { id: statusId }
|
if (userId) {
|
||||||
remove(timelineObject.statuses, status)
|
remove(timelineObject.statuses, { user: { id: userId } })
|
||||||
remove(timelineObject.visibleStatuses, status)
|
remove(timelineObject.visibleStatuses, { user: { id: userId } })
|
||||||
if (statusId) {
|
timelineObject.minVisibleId = timelineObject.visibleStatuses.length > 0 ? last(timelineObject.visibleStatuses).id : 0
|
||||||
delete timelineObject.statusesObject[statusId]
|
timelineObject.maxId = timelineObject.statuses.length > 0 ? first(timelineObject.statuses).id : 0
|
||||||
delete timelineObject.visibleStatusesObject[statusId]
|
|
||||||
sortTimeline(timelineObject)
|
|
||||||
}
|
}
|
||||||
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 = {
|
export const mutations = {
|
||||||
|
|
Loading…
Reference in a new issue