aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-07-20 16:54:30 -0400
committertaehoon <th.dev91@gmail.com>2019-07-24 21:02:37 -0400
commit0f8ace483649c1da66a1270373a3b95683ff9a0b (patch)
tree23e8c7336fbe9f63d7908c6d2b7c0f80ec160bdb
parent876c6de8066d9ac708bb0cd8e4d4c5e60f9502a6 (diff)
update status eliminating logic
-rw-r--r--src/components/timeline/timeline.js14
-rw-r--r--src/components/timeline/timeline.vue16
2 files changed, 19 insertions, 11 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 7c8a761a..b1413591 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -41,12 +41,18 @@ const Timeline = {
footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : [])
}
},
- statuses () {
+ // id map of statuses which need to be hidden in the main list due to pinning logic
+ excludedStatusIdsObject () {
+ const result = {}
if (this.pinnedStatusIds && this.pinnedStatusIds.length > 0) {
- return this.timeline.visibleStatuses && this.timeline.visibleStatuses.filter(status => !this.pinnedStatusIds.includes(status.id))
- } else {
- return this.timeline.visibleStatuses
+ for (let status of this.timeline.visibleStatuses) {
+ if (this.pinnedStatusIds.indexOf(status.id) === -1) {
+ break
+ }
+ result[status.id] = true
+ }
}
+ return result
}
},
components: {
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index 4337ac36..0cb4b3ef 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -38,13 +38,15 @@
:show-pinned="true"
/>
</template>
- <conversation
- v-for="status in statuses"
- :key="status.id"
- class="status-fadein"
- :statusoid="status"
- :collapsable="true"
- />
+ <template v-for="status in timeline.visibleStatuses">
+ <conversation
+ v-if="!excludedStatusIdsObject[status.id]"
+ :key="status.id"
+ class="status-fadein"
+ :statusoid="status"
+ :collapsable="true"
+ />
+ </template>
</div>
</div>
<div :class="classes.footer">