diff --git a/packages/protocol-dashboard/src/components/RegisterNodeCard/RegisterNodeCard.tsx b/packages/protocol-dashboard/src/components/RegisterNodeCard/RegisterNodeCard.tsx index a968b281018..5017eaff4b3 100644 --- a/packages/protocol-dashboard/src/components/RegisterNodeCard/RegisterNodeCard.tsx +++ b/packages/protocol-dashboard/src/components/RegisterNodeCard/RegisterNodeCard.tsx @@ -84,7 +84,7 @@ export const RegisterNodeCard = ({ wallet }: { wallet: string }) => { - {storageCommitment == null ? ( + {currentVersion == null ? ( diff --git a/packages/protocol-dashboard/src/store/cache/protocol/hooks.ts b/packages/protocol-dashboard/src/store/cache/protocol/hooks.ts index 7d592ffeac6..eca1262649c 100644 --- a/packages/protocol-dashboard/src/store/cache/protocol/hooks.ts +++ b/packages/protocol-dashboard/src/store/cache/protocol/hooks.ts @@ -38,7 +38,7 @@ export const getCurrentVersion = ( case ServiceType.ContentNode: return state.cache.protocol.services.contentNode.currentVersion case ServiceType.Validator: - return state.cache.protocol.services.validator?.currentVersion ?? '1.0.0' + return state.cache.protocol.services.validator?.currentVersion } } diff --git a/packages/protocol-dashboard/src/store/cache/protocol/slice.ts b/packages/protocol-dashboard/src/store/cache/protocol/slice.ts index 7f00158e1eb..7fb339e1430 100644 --- a/packages/protocol-dashboard/src/store/cache/protocol/slice.ts +++ b/packages/protocol-dashboard/src/store/cache/protocol/slice.ts @@ -55,9 +55,18 @@ const slice = createSlice({ state.delegator.maxDelegators = action.payload.maxDelegators }, setServiceTypeInfo: (state, action: PayloadAction) => { - state.services.discoveryProvider = action.payload.discoveryProvider - state.services.contentNode = action.payload.contentNode - state.services.validator = action.payload.validator + state.services.discoveryProvider = { + ...action.payload.discoveryProvider, + currentVersion: state.services.discoveryProvider?.currentVersion + } + state.services.contentNode = { + ...action.payload.contentNode, + currentVersion: state.services.contentNode?.currentVersion + } + state.services.validator = { + ...action.payload.validator, + currentVersion: state.services.validator?.currentVersion + } }, setEthBlockNumber: (state, action: PayloadAction) => { state.ethBlockNumber = action.payload @@ -82,8 +91,14 @@ const slice = createSlice({ action.payload.currentVersion break case ServiceType.Validator: - state.services.validator.currentVersion = - action.payload.currentVersion + state.services.validator = { + ...(state.services.validator ?? { + isValid: false, + minStake: new BN(0), + maxStake: new BN(0) + }), + currentVersion: action.payload.currentVersion + } break } }