Add fetching of older statuses.
This commit is contained in:
parent
1a94217222
commit
e1103f04a4
4 changed files with 36 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
import Status from '../status/status.vue'
|
||||
import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js'
|
||||
|
||||
const Timeline = {
|
||||
props: [
|
||||
|
@ -11,6 +12,18 @@ const Timeline = {
|
|||
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 }))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue