pinafore/routes/_components/timeline/PinnedStatuses.html

33 lines
949 B
HTML
Raw Normal View History

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