From 4b444708f2594028e47dad91f1e90728592474ae Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 15 Aug 2019 13:07:07 -0400 Subject: [PATCH 1/3] fix pin showing logic in conversation --- src/components/conversation/conversation.js | 7 +++++-- src/components/conversation/conversation.vue | 2 +- src/components/status/status.vue | 2 +- src/components/timeline/timeline.vue | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index a2b3aeab..cb4db8ea 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,4 @@ -import { reduce, filter, findIndex, clone } from 'lodash' +import { reduce, filter, findIndex, clone, keyBy } from 'lodash' import Status from '../status/status.vue' const sortById = (a, b) => { @@ -42,7 +42,7 @@ const conversation = { 'statusoid', 'collapsable', 'isPage', - 'showPinned' + 'pinnedStatusIds' ], created () { if (this.isPage) { @@ -104,6 +104,9 @@ const conversation = { }, isExpanded () { return this.expanded || this.isPage + }, + pinnedStatusIdsObject () { + return keyBy(this.pinnedStatusIds, id => id) } }, components: { diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 5a900607..d4e199c1 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -21,7 +21,7 @@ :inline-expanded="collapsable && isExpanded" :statusoid="status" :expandable="!isExpanded" - :show-pinned="showPinned" + :show-pinned="pinnedStatusIdsObject[status.id]" :focused="focused(status.id)" :in-conversation="isExpanded" :highlight="getHighlight()" diff --git a/src/components/status/status.vue b/src/components/status/status.vue index ab506632..64218f6e 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -32,7 +32,7 @@