forked from AkkomaGang/akkoma-fe
Merge branch 'feature/timeline-fetch-error' into 'develop'
Move rejection handler See merge request !48
This commit is contained in:
commit
aeda390da0
1 changed files with 4 additions and 3 deletions
|
@ -5,6 +5,8 @@ import apiService from '../api/api.service.js'
|
||||||
const update = ({store, statuses, timeline, showImmediately}) => {
|
const update = ({store, statuses, timeline, showImmediately}) => {
|
||||||
const ccTimeline = camelCase(timeline)
|
const ccTimeline = camelCase(timeline)
|
||||||
|
|
||||||
|
setError({store, timeline, value: false})
|
||||||
|
|
||||||
store.dispatch('addNewStatuses', {
|
store.dispatch('addNewStatuses', {
|
||||||
timeline: ccTimeline,
|
timeline: ccTimeline,
|
||||||
statuses,
|
statuses,
|
||||||
|
@ -33,9 +35,8 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiService.fetchTimeline(args)
|
return apiService.fetchTimeline(args)
|
||||||
.then((statuses) => update({store, statuses, timeline, showImmediately}))
|
.then((statuses) => update({store, statuses, timeline, showImmediately}),
|
||||||
.then(() => setError({store, timeline, value: false}))
|
() => setError({store, timeline, value: true}))
|
||||||
.catch(() => setError({store, timeline, value: true}))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const startFetching = ({ timeline = 'friends', credentials, store }) => {
|
const startFetching = ({ timeline = 'friends', credentials, store }) => {
|
||||||
|
|
Loading…
Reference in a new issue