diff options
Diffstat (limited to 'src/components/timeline/timeline.js')
| -rw-r--r-- | src/components/timeline/timeline.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 433bca11..e0c75d76 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -1,4 +1,5 @@ import Status from '../status/status.vue' +import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js' const Timeline = { props: [ @@ -8,9 +9,32 @@ const Timeline = { components: { Status }, + created () { + const store = this.$store + const credentials = store.state.users.currentUser.credentials + + timelineFetcher.fetchAndUpdate({ + store, + credentials, + timeline: this.timelineName, + showImmediately: true + }) + }, methods: { showNewStatuses () { this.$store.commit('showNewStatuses', { timeline: this.timelineName }) + }, + fetchOlderStatuses () { + const store = this.$store + const credentials = store.state.users.currentUser.credentials + store.commit('setLoading', { timeline: this.timelineName, value: true }); + timelineFetcher.fetchAndUpdate({ + store, + credentials, + timeline: this.timelineName, + older: true, + showImmediately: true + }).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false })) } } } |
