aboutsummaryrefslogtreecommitdiff
path: root/src/services/timeline_fetcher/timeline_fetcher.service.js
diff options
context:
space:
mode:
authorwakarimasen <wakarimasen@airmail.cc>2017-03-07 21:38:55 +0100
committerwakarimasen <wakarimasen@airmail.cc>2017-03-07 21:38:55 +0100
commit7d522583780cae5746112f204b3f8c604d5a87bd (patch)
treee1481e5eb67b9d8d6552d1bc8bf4407199a2a6ed /src/services/timeline_fetcher/timeline_fetcher.service.js
parent086dd832d3d2c8103e7d6f99d72d27bea97ce7b0 (diff)
Move rejection handler
Diffstat (limited to 'src/services/timeline_fetcher/timeline_fetcher.service.js')
-rw-r--r--src/services/timeline_fetcher/timeline_fetcher.service.js7
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 }) => {