2018-03-14 06:54:20 +01:00
|
|
|
<template>
|
|
|
|
<div id="public">
|
|
|
|
<div class="public-timeline" v-for="message in timeline" v-bind:key="message.id">
|
2018-03-14 10:15:19 +01:00
|
|
|
<toot :message="message" v-on:update="updateToot"></toot>
|
2018-03-14 06:54:20 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
import Toot from './Cards/Toot'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'public',
|
|
|
|
components: { Toot },
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
account: state => state.TimelineSpace.account,
|
|
|
|
timeline: state => state.TimelineSpace.Public.timeline
|
|
|
|
})
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
this.$store.dispatch('TimelineSpace/Public/startPublicStreaming', this.account)
|
|
|
|
},
|
|
|
|
beforeDestroy () {
|
|
|
|
this.$store.dispatch('TimelineSpace/Public/stopPublicStreaming')
|
2018-03-14 10:15:19 +01:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateToot (message) {
|
|
|
|
this.$store.commit('TimelineSpace/Public/updateToot', message)
|
|
|
|
}
|
2018-03-14 06:54:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|