diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 9a53acd6..245e0a60 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -3,19 +3,6 @@ import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.se import Conversation from '../conversation/conversation.vue' import { throttle, keyBy } from 'lodash' -export const getExcludedStatusIdsByPinning = (statuses, pinnedStatusIds) => { - const ids = [] - if (pinnedStatusIds && pinnedStatusIds.length > 0) { - for (let status of statuses) { - if (!pinnedStatusIds.includes(status.id)) { - break - } - ids.push(status.id) - } - } - return ids -} - const Timeline = { props: [ 'timeline', @@ -60,14 +47,11 @@ const Timeline = { footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : []) } }, - // id map of statuses which need to be hidden in the main list due to pinning logic - excludedStatusIdsObject () { - const ids = getExcludedStatusIdsByPinning(this.timeline.visibleStatuses, this.pinnedStatusIds) - // Convert id array to object - return keyBy(ids) - }, pinnedStatusIdsObject () { return keyBy(this.pinnedStatusIds) + }, + pinnedStatuses () { + return this.$store.state.statuses.timelines.pins.visibleStatuses.filter(status => status.user.id === this.userId) } }, components: { diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 9777bd0c..496b4247 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -35,12 +35,11 @@