const coreConfigReducer = (key, state, defaultState, action) => {
if (action.type == 'UPDATE_CORE_INFO') {
- return action.param[key] || defaultState
+ return action.param.data[key] || defaultState
}
return state || defaultState
return state
}
-const version = (state, action) => coreConfigReducer('version', state, 'N/A', action)
+const version = (state = 'N/A', action) => {
+ if (action.type == 'UPDATE_CORE_INFO') {
+ return action.param.data.versionInfo.version
+ }
+ return state
+}
+
+const newVersionCode = (state = 'N/A', action) => {
+ if (action.type == 'UPDATE_CORE_INFO') {
+ return action.param.data.versionInfo.newVersion
+ }
+ return state
+}
+
+const update = (state = false, action) => {
+ if (action.type == 'UPDATE_CORE_INFO') {
+ return action.param.data.versionInfo.update > 0
+ }
+ return state
+}
export default combineReducers({
generatorBlockHeight,
generatorUrl,
localhostAuth,
+ newVersionCode,
mockhsm,
mingStatus,
crosscoreRpcVersion,
signer,
snapshot,
syncEstimates,
+ update,
validToken,
version,
lang,