diff options
| author | Roger Braun <roger@rogerbraun.net> | 2017-03-10 13:27:58 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2017-03-10 13:27:58 +0100 |
| commit | 112adcf8f83e1bd8dd347ef8ee4de46060b53341 (patch) | |
| tree | aa6288f000d72dfd2f166642d413637a77f1aa42 /src/services/timeline_fetcher/timeline_fetcher.service.js | |
| parent | 0eeccb87cef4d137710e3c7fd215b94e45aff3d1 (diff) | |
| parent | 33f72ab2c215ebd7709edaf7a63062aabe8363cc (diff) | |
Merge branch 'develop' into feature/hash-routed
Diffstat (limited to 'src/services/timeline_fetcher/timeline_fetcher.service.js')
| -rw-r--r-- | src/services/timeline_fetcher/timeline_fetcher.service.js | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index e684a170..24aef069 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -5,7 +5,7 @@ import apiService from '../api/api.service.js' const update = ({store, statuses, timeline, showImmediately}) => { const ccTimeline = camelCase(timeline) - setError({store, timeline, value: false}) + store.dispatch('setError', { value: false }) store.dispatch('addNewStatuses', { timeline: ccTimeline, @@ -14,15 +14,6 @@ const update = ({store, statuses, timeline, showImmediately}) => { }) } -const setError = ({store, timeline, value}) => { - const ccTimeline = camelCase(timeline) - - store.dispatch('setError', { - timeline: ccTimeline, - value - }) -} - const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false}) => { const args = { timeline, credentials } const rootState = store.rootState || store.state @@ -36,7 +27,7 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false return apiService.fetchTimeline(args) .then((statuses) => update({store, statuses, timeline, showImmediately}), - () => setError({store, timeline, value: true})) + () => store.dispatch('setError', { value: true })) } const startFetching = ({ timeline = 'friends', credentials, store }) => { |
