* client: add link to the update error

This commit is contained in:
Ildar Kamalov
2019-05-17 18:17:17 +03:00
committed by Simon Zolin
parent 24f582d36d
commit 967517316f
5 changed files with 38 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ const apiClient = new Api();
export const addErrorToast = createAction('ADD_ERROR_TOAST');
export const addSuccessToast = createAction('ADD_SUCCESS_TOAST');
export const addNoticeToast = createAction('ADD_NOTICE_TOAST');
export const removeToast = createAction('REMOVE_TOAST');
export const toggleSettingStatus = createAction('SETTING_STATUS_TOGGLE');
@@ -169,7 +170,7 @@ export const getUpdate = () => async (dispatch) => {
let timeout;
if (count > 60) {
dispatch(addErrorToast({ error: 'update_failed_try_later' }));
dispatch(addNoticeToast({ error: 'update_failed' }));
dispatch(getUpdateFailure());
return false;
}
@@ -181,8 +182,6 @@ export const getUpdate = () => async (dispatch) => {
...args,
);
console.log(count);
axios.get('control/status')
.then((response) => {
rmTimeout(timeout);
@@ -202,7 +201,7 @@ export const getUpdate = () => async (dispatch) => {
checkUpdate();
} catch (error) {
dispatch(addErrorToast({ error: 'update_failed' }));
dispatch(addNoticeToast({ error: 'update_failed' }));
dispatch(getUpdateFailure());
}
};