Improve how errors are displayed in the UI

This commit is contained in:
Eugen Rochko 2016-10-18 17:09:45 +02:00
parent aea151a0de
commit f88b8ce757
11 changed files with 54 additions and 80 deletions

View file

@ -48,7 +48,6 @@ export function fetchAccount(id) {
axios.all([boundApi.get(`/api/v1/accounts/${id}`), boundApi.get(`/api/v1/accounts/relationships?id=${id}`)]).then(values => {
dispatch(fetchAccountSuccess(values[0].data, values[1].data[0]));
}).catch(error => {
console.error(error);
dispatch(fetchAccountFail(id, error));
});
};
@ -61,7 +60,6 @@ export function fetchAccountTimeline(id) {
api(getState).get(`/api/v1/accounts/${id}/statuses`).then(response => {
dispatch(fetchAccountTimelineSuccess(id, response.data));
}).catch(error => {
console.error(error);
dispatch(fetchAccountTimelineFail(id, error));
});
};
@ -76,7 +74,6 @@ export function expandAccountTimeline(id) {
api(getState).get(`/api/v1/accounts/${id}/statuses?max_id=${lastId}`).then(response => {
dispatch(expandAccountTimelineSuccess(id, response.data));
}).catch(error => {
console.error(error);
dispatch(expandAccountTimelineFail(id, error));
});
};
@ -112,7 +109,6 @@ export function followAccount(id) {
api(getState).post(`/api/v1/accounts/${id}/follow`).then(response => {
dispatch(followAccountSuccess(response.data));
}).catch(error => {
console.error(error);
dispatch(followAccountFail(error));
});
};
@ -125,7 +121,6 @@ export function unfollowAccount(id) {
api(getState).post(`/api/v1/accounts/${id}/unfollow`).then(response => {
dispatch(unfollowAccountSuccess(response.data));
}).catch(error => {
console.error(error);
dispatch(unfollowAccountFail(error));
});
}
@ -226,7 +221,6 @@ export function blockAccount(id) {
api(getState).post(`/api/v1/accounts/${id}/block`).then(response => {
dispatch(blockAccountSuccess(response.data));
}).catch(error => {
console.error(error);
dispatch(blockAccountFail(id, error));
});
};
@ -239,7 +233,6 @@ export function unblockAccount(id) {
api(getState).post(`/api/v1/accounts/${id}/unblock`).then(response => {
dispatch(unblockAccountSuccess(response.data));
}).catch(error => {
console.error(error);
dispatch(unblockAccountFail(id, error));
});
};