Add tag timeline view.

This commit is contained in:
eal 2017-09-17 14:26:35 +03:00
parent 3eaaa4c16d
commit 9abfcb34ef
9 changed files with 82 additions and 10 deletions

View file

@ -0,0 +1,26 @@
import Timeline from '../timeline/timeline.vue'
const TagTimeline = {
created () {
this.$store.commit('clearTimeline', { timeline: 'tag' })
this.$store.dispatch('startFetching', { 'tag': this.tag })
},
components: {
Timeline
},
computed: {
tag () { return this.$route.params.tag },
timeline () { return this.$store.state.statuses.timelines.tag }
},
watch: {
tag () {
this.$store.commit('clearTimeline', { timeline: 'tag' })
this.$store.dispatch('startFetching', { 'tag': this.tag })
}
},
destroyed () {
this.$store.dispatch('stopFetching', 'tag')
}
}
export default TagTimeline

View file

@ -0,0 +1,12 @@
import Timeline from '../timeline/timeline.vue'
const TagTimeline = {
components: {
Timeline
},
computed: {
timeline () { return this.$store.state.statuses.timelines.tag }
}
};
export default TagTimeline

View file

@ -0,0 +1,5 @@
<template>
<Timeline :title="tag" :timeline="timeline" :timeline-name="'tag'" :tag="tag" />
</template>
<script src='./tag_timeline.js'></script>

View file

@ -0,0 +1,5 @@
<template>
<div> timleinei </div>
</template>
<script src='./tag_timeline.js'></script>

View file

@ -8,7 +8,8 @@ const Timeline = {
'timeline',
'timelineName',
'title',
'userId'
'userId',
'tag'
],
computed: {
timelineError () { return this.$store.state.statuses.error },
@ -39,7 +40,8 @@ const Timeline = {
credentials,
timeline: this.timelineName,
showImmediately,
userId: this.userId
userId: this.userId,
tag: this.tag
})
// don't fetch followers for public, friend, twkn
@ -62,7 +64,8 @@ const Timeline = {
timeline: this.timelineName,
older: true,
showImmediately: true,
userId: this.userId
userId: this.userId,
tag: this.tag
}).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false }))
},
fetchFollowers () {