fix pin showing logic in conversation

This commit is contained in:
taehoon 2019-08-15 13:07:07 -04:00
parent 61f61947ad
commit 4b444708f2
4 changed files with 8 additions and 5 deletions

View File

@ -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: {

View File

@ -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()"

View File

@ -32,7 +32,7 @@
</template>
<template v-else>
<div
v-if="showPinned && statusoid.pinned"
v-if="showPinned"
class="status-pin"
>
<i class="fa icon-pin faint" />

View File

@ -35,7 +35,7 @@
class="status-fadein"
:statusoid="timeline.statusesObject[statusId]"
:collapsable="true"
:show-pinned="true"
:pinned-status-ids="pinnedStatusIds"
/>
</template>
<template v-for="status in timeline.visibleStatuses">