Change getVersionSuccess reducer

This commit is contained in:
ArtemBaskal 2020-07-14 18:42:24 +03:00
parent 54693bb158
commit 61981a927b
1 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ const dashboard = handleActions(
[actions.getVersionSuccess]: (state, { payload }) => { [actions.getVersionSuccess]: (state, { payload }) => {
const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion;
if (payload && isVersionGreater(currentVersion, payload.new_version)) { if (!payload.disabled && isVersionGreater(currentVersion, payload.new_version)) {
const { const {
announcement_url: announcementUrl, announcement_url: announcementUrl,
new_version: newVersion, new_version: newVersion,
@ -96,7 +96,7 @@ const dashboard = handleActions(
canAutoUpdate, canAutoUpdate,
isUpdateAvailable: true, isUpdateAvailable: true,
processingVersion: false, processingVersion: false,
checkUpdateFlag: !!payload, checkUpdateFlag: !payload.disabled,
}; };
return newState; return newState;
} }
@ -104,6 +104,7 @@ const dashboard = handleActions(
return { return {
...state, ...state,
processingVersion: false, processingVersion: false,
checkUpdateFlag: !payload.disabled,
}; };
}, },