mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-14 12:34:46 +00:00
generate idObj at timeline level
This commit is contained in:
parent
4b444708f2
commit
1146119d6a
4 changed files with 7 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
import { reduce, filter, findIndex, clone, keyBy } from 'lodash'
|
||||
import { reduce, filter, findIndex, clone } from 'lodash'
|
||||
import Status from '../status/status.vue'
|
||||
|
||||
const sortById = (a, b) => {
|
||||
|
@ -42,7 +42,7 @@ const conversation = {
|
|||
'statusoid',
|
||||
'collapsable',
|
||||
'isPage',
|
||||
'pinnedStatusIds'
|
||||
'pinnedStatusIdsObject'
|
||||
],
|
||||
created () {
|
||||
if (this.isPage) {
|
||||
|
@ -104,9 +104,6 @@ const conversation = {
|
|||
},
|
||||
isExpanded () {
|
||||
return this.expanded || this.isPage
|
||||
},
|
||||
pinnedStatusIdsObject () {
|
||||
return keyBy(this.pinnedStatusIds, id => id)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
:inline-expanded="collapsable && isExpanded"
|
||||
:statusoid="status"
|
||||
:expandable="!isExpanded"
|
||||
:show-pinned="pinnedStatusIdsObject[status.id]"
|
||||
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
|
||||
:focused="focused(status.id)"
|
||||
:in-conversation="isExpanded"
|
||||
:highlight="getHighlight()"
|
||||
|
|
|
@ -59,6 +59,9 @@ const Timeline = {
|
|||
const ids = getExcludedStatusIdsByPinning(this.timeline.visibleStatuses, this.pinnedStatusIds)
|
||||
// Convert id array to object
|
||||
return keyBy(ids, id => id)
|
||||
},
|
||||
pinnedStatusIdsObject () {
|
||||
return keyBy(this.pinnedStatusIds, id => id)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
class="status-fadein"
|
||||
:statusoid="timeline.statusesObject[statusId]"
|
||||
:collapsable="true"
|
||||
:pinned-status-ids="pinnedStatusIds"
|
||||
:pinned-status-ids-object="pinnedStatusIdsObject"
|
||||
/>
|
||||
</template>
|
||||
<template v-for="status in timeline.visibleStatuses">
|
||||
|
|
Loading…
Reference in a new issue