diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/api/api.service.js | 7 | ||||
| -rw-r--r-- | src/services/timeline_fetcher/timeline_fetcher.service.js | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 45b63caf..63e72e30 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -529,9 +529,12 @@ const fetchTimeline = ({ const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&') url += `?${queryString}` - + let status = '' + let statusText = '' return fetch(url, { headers: authHeaders(credentials) }) .then((data) => { + status = data.status + statusText = data.statusText return data }) .then((data) => data.json()) @@ -539,6 +542,8 @@ const fetchTimeline = ({ if (!data.error) { return data.map(isNotifications ? parseNotification : parseStatus) } else { + data.status = status + data.statusText = statusText return data } }) diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index 68644261..c6b28ad5 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -6,7 +6,7 @@ const update = ({ store, statuses, timeline, showImmediately, userId }) => { const ccTimeline = camelCase(timeline) store.dispatch('setError', { value: false }) - store.dispatch('setErrorData', { value: false }) + store.dispatch('setErrorData', { value: null }) store.dispatch('addNewStatuses', { timeline: ccTimeline, @@ -47,7 +47,7 @@ const fetchAndUpdate = ({ return apiService.fetchTimeline(args) .then((statuses) => { if (statuses.error) { - store.dispatch('setErrorData', { value: statuses.error }) + store.dispatch('setErrorData', { value: statuses }) return } if (!older && statuses.length >= 20 && !timelineData.loading && numStatusesBeforeFetch > 0) { |
