+ client: add button for check updates

This commit is contained in:
Ildar Kamalov
2019-06-25 17:56:50 +03:00
parent 5d60bb05ab
commit 0e9df33a40
12 changed files with 88 additions and 37 deletions

View File

@@ -145,11 +145,14 @@ export const getVersionRequest = createAction('GET_VERSION_REQUEST');
export const getVersionFailure = createAction('GET_VERSION_FAILURE');
export const getVersionSuccess = createAction('GET_VERSION_SUCCESS');
export const getVersion = () => async (dispatch) => {
export const getVersion = (recheck = false) => async (dispatch) => {
dispatch(getVersionRequest());
try {
const newVersion = await apiClient.getGlobalVersion();
const newVersion = await apiClient.getGlobalVersion({ recheck_now: recheck });
dispatch(getVersionSuccess(newVersion));
if (recheck) {
dispatch(addSuccessToast('updates_checked'));
}
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getVersionFailure());