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' import Status from '../status/status.vue'
const sortById = (a, b) => { const sortById = (a, b) => {
@ -42,7 +42,7 @@ const conversation = {
'statusoid', 'statusoid',
'collapsable', 'collapsable',
'isPage', 'isPage',
'showPinned' 'pinnedStatusIds'
], ],
created () { created () {
if (this.isPage) { if (this.isPage) {
@ -104,6 +104,9 @@ const conversation = {
}, },
isExpanded () { isExpanded () {
return this.expanded || this.isPage return this.expanded || this.isPage
},
pinnedStatusIdsObject () {
return keyBy(this.pinnedStatusIds, id => id)
} }
}, },
components: { components: {

View File

@ -21,7 +21,7 @@
:inline-expanded="collapsable && isExpanded" :inline-expanded="collapsable && isExpanded"
:statusoid="status" :statusoid="status"
:expandable="!isExpanded" :expandable="!isExpanded"
:show-pinned="showPinned" :show-pinned="pinnedStatusIdsObject[status.id]"
:focused="focused(status.id)" :focused="focused(status.id)"
:in-conversation="isExpanded" :in-conversation="isExpanded"
:highlight="getHighlight()" :highlight="getHighlight()"

View File

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

View File

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