2018-04-09 01:43:11 +02:00
|
|
|
<template>
|
|
|
|
<div id="lists">
|
2018-04-09 14:10:25 +02:00
|
|
|
<div class="list-timeline" v-for="message in timeline" v-bind:key="message.id">
|
|
|
|
<toot :message="message"></toot>
|
|
|
|
</div>
|
2018-04-09 01:43:11 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-04-09 14:10:25 +02:00
|
|
|
import { mapState } from 'vuex'
|
|
|
|
import Toot from './Cards/Toot'
|
|
|
|
|
2018-04-09 01:43:11 +02:00
|
|
|
export default {
|
2018-04-09 14:10:25 +02:00
|
|
|
name: 'lists',
|
|
|
|
props: ['list_id'],
|
|
|
|
components: { Toot },
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
timeline: state => state.TimelineSpace.Contents.Lists.timeline
|
|
|
|
})
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
this.load()
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
list_id: function () {
|
|
|
|
this.load()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
load () {
|
|
|
|
const loading = this.$loading({
|
|
|
|
lock: true,
|
|
|
|
text: 'Loading',
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
})
|
|
|
|
this.$store.dispatch('TimelineSpace/Contents/Lists/fetchTimeline', this.list_id)
|
|
|
|
.then(() => {
|
|
|
|
loading.close()
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
loading.close()
|
|
|
|
this.$message({
|
|
|
|
message: 'Failed to get timeline',
|
|
|
|
type: 'error'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2018-04-09 01:43:11 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|