diff options
| author | Shpuld Shpuldson <shpuld@gmail.com> | 2017-03-08 19:03:06 -0500 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@gmail.com> | 2017-03-08 19:03:06 -0500 |
| commit | aeda390da0ef99a8fda9f059cf4d8168aa1938c2 (patch) | |
| tree | ca9775cbb306ea8e128cef6244f7788ea3e86609 /src | |
| parent | 5997492795d5cf2d0f575c65e87991348297cdf6 (diff) | |
| parent | 7d522583780cae5746112f204b3f8c604d5a87bd (diff) | |
Merge branch 'feature/timeline-fetch-error' into 'develop'
Move rejection handler
See merge request !48
Diffstat (limited to 'src')
| -rw-r--r-- | src/services/timeline_fetcher/timeline_fetcher.service.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index 40f568c3..e684a170 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -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 }) => { |
