From 8308315038b6e672e79aee5956d9feabe8d1004d Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 24 Apr 2019 21:49:44 -0400
Subject: [PATCH] revert removeStatus changes
---
src/modules/statuses.js | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index b3d6802c..68666982 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -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 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
}
- 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 = {