1
0
mirror of https://git.pleroma.social/sjw/pleroma-fe.git synced 2024-12-25 06:45:01 +01:00

Merge branch 'feature/timeline-fetch-error' into 'develop'

Move rejection handler

See merge request !48
This commit is contained in:
Shpuld Shpuldson 2017-03-08 19:03:06 -05:00
commit aeda390da0

View File

@ -5,6 +5,8 @@ import apiService from '../api/api.service.js'
const update = ({store, statuses, timeline, showImmediately}) => {
const ccTimeline = camelCase(timeline)
setError({store, timeline, value: false})
store.dispatch('addNewStatuses', {
timeline: ccTimeline,
statuses,
@ -33,9 +35,8 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
}
return apiService.fetchTimeline(args)
.then((statuses) => update({store, statuses, timeline, showImmediately}))
.then(() => setError({store, timeline, value: false}))
.catch(() => setError({store, timeline, value: true}))
.then((statuses) => update({store, statuses, timeline, showImmediately}),
() => setError({store, timeline, value: true}))
}
const startFetching = ({ timeline = 'friends', credentials, store }) => {