2018-02-19 17:17:22 +00:00
|
|
|
<div role="feed" aria-label="Pinned toots" class="pinned-statuses">
|
2018-04-29 19:28:44 +00:00
|
|
|
{{#each pinnedStatuses as status, index @id}}
|
|
|
|
<Status :status
|
|
|
|
timelineType="pinned"
|
2018-04-30 00:45:03 +00:00
|
|
|
timelineValue={{accountId}}
|
2018-04-29 19:28:44 +00:00
|
|
|
:index
|
2018-04-30 00:45:03 +00:00
|
|
|
length={{pinnedStatuses.length}}
|
2018-04-29 19:28:44 +00:00
|
|
|
/>
|
|
|
|
{{/each}}
|
2018-02-11 18:35:25 +00:00
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
import { store } from '../../_store/store'
|
|
|
|
import Status from '../status/Status.html'
|
|
|
|
import { updatePinnedStatusesForAccount } from '../../_actions/pinnedStatuses'
|
2018-04-29 19:28:44 +00:00
|
|
|
import { on } from '../../_utils/eventBus'
|
2018-02-11 18:35:25 +00:00
|
|
|
|
|
|
|
export default {
|
2018-04-20 04:38:01 +00:00
|
|
|
async oncreate () {
|
2018-04-29 19:28:44 +00:00
|
|
|
on('updatePinnedStatuses', this, () => this.updatePinnedStatuses())
|
|
|
|
await this.updatePinnedStatuses()
|
2018-02-11 18:35:25 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
pinnedStatuses: ($pinnedStatuses, $currentInstance, accountId) => {
|
2018-04-29 19:28:44 +00:00
|
|
|
return ($pinnedStatuses[$currentInstance] && $pinnedStatuses[$currentInstance][accountId]) || []
|
2018-02-11 18:35:25 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
store: () => store,
|
|
|
|
components: {
|
2018-02-12 07:10:07 +00:00
|
|
|
Status
|
2018-04-29 19:28:44 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async updatePinnedStatuses () {
|
|
|
|
let { accountId } = this.get()
|
|
|
|
await updatePinnedStatusesForAccount(accountId)
|
|
|
|
}
|
2018-02-11 18:35:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|