aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorjasper <jasper92341@hotmail.com>2019-02-25 14:35:47 -0800
committerjasper <jasper92341@hotmail.com>2019-02-25 14:35:47 -0800
commit4e79300232288fd9b7c4456e8b461f7c1cbac6fa (patch)
treeca87e38d359df7b1b51411b380e5c72b7786b90f /src/modules
parent24d7f9917b1a4a147b92bd31ec65511c1d528c6f (diff)
Remove posts by blocking or unfollowing
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/statuses.js18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 57095f37..d144702e 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -1,4 +1,4 @@
-import { remove, slice, each, find, maxBy, minBy, merge, last, isArray } from 'lodash'
+import { remove, slice, each, find, maxBy, minBy, merge, first, last, isArray } from 'lodash'
import apiService from '../services/api/api.service.js'
// import parse from '../services/status_parser/status_parser.js'
@@ -312,20 +312,8 @@ const removeStatus = (state, { timeline, userId }) => {
if (userId) {
remove(timelineObject.statuses, { user: { id: userId } })
remove(timelineObject.visibleStatuses, { user: { id: userId } })
- const statusesObject = timelineObject.statusesObject
- const visibleStatusesObject = timelineObject.visibleStatusesObject
- each(statusesObject, (status, key) => {
- if (status.user.id === userId) {
- delete statusesObject[key]
- }
- })
- each(visibleStatusesObject, (status, key) => {
- if (status.user.id === userId) {
- delete visibleStatusesObject[key]
- }
- })
- timelineObject.minVisibleId = (last(timeline.visibleStatuses) || {}).id
- timelineObject.maxId = statuses.length > 0 ? maxBy(statuses, 'id').id : 0
+ timelineObject.minVisibleId = timelineObject.visibleStatuses.length > 0 ? last(timelineObject.visibleStatuses).id : 0
+ timelineObject.maxId = timelineObject.statuses.length > 0 ? first(timelineObject.statuses).id : 0
}
}