diff options
| author | lambadalambda <gitgud@rogerbraun.net> | 2017-09-17 07:58:05 -0400 |
|---|---|---|
| committer | lambadalambda <gitgud@rogerbraun.net> | 2017-09-17 07:58:05 -0400 |
| commit | 91991e2ac1765a17bc5cd0038507c577a0d12045 (patch) | |
| tree | 3b76538396254fdcddf49e8b73d32db4ae41ee5c /src/components | |
| parent | 3eaaa4c16de3355e47d1a8c5c74e19cc492e37a5 (diff) | |
| parent | c96a7b582bfc12b4af437fbd0d75ed8762065288 (diff) | |
Merge branch 'feature/tag-timelines' into 'develop'
Add tag timeline view.
See merge request !121
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/tag_timeline/tag_timeline.js | 26 | ||||
| -rw-r--r-- | src/components/tag_timeline/tag_timeline.vue | 5 | ||||
| -rw-r--r-- | src/components/timeline/timeline.js | 9 |
3 files changed, 37 insertions, 3 deletions
diff --git a/src/components/tag_timeline/tag_timeline.js b/src/components/tag_timeline/tag_timeline.js new file mode 100644 index 00000000..43de4f49 --- /dev/null +++ b/src/components/tag_timeline/tag_timeline.js @@ -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 diff --git a/src/components/tag_timeline/tag_timeline.vue b/src/components/tag_timeline/tag_timeline.vue new file mode 100644 index 00000000..62bb579a --- /dev/null +++ b/src/components/tag_timeline/tag_timeline.vue @@ -0,0 +1,5 @@ +<template> + <Timeline :title="tag" :timeline="timeline" :timeline-name="'tag'" :tag="tag" /> +</template> + +<script src='./tag_timeline.js'></script>
\ No newline at end of file diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 06435745..bd80d57b 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -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 () { |
