Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const RegisterNodeCard = ({ wallet }: { wallet: string }) => {
<Flex alignItems='center' gap='xl'>
<Card p='xl' direction='column'>
<Box>
{storageCommitment == null ? (
{currentVersion == null ? (
<Box mb='xs'>
<Loading />
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
25 changes: 20 additions & 5 deletions packages/protocol-dashboard/src/store/cache/protocol/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,18 @@ const slice = createSlice({
state.delegator.maxDelegators = action.payload.maxDelegators
},
setServiceTypeInfo: (state, action: PayloadAction<SetServiceTypeInfo>) => {
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<number>) => {
state.ethBlockNumber = action.payload
Expand All @@ -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
}
}
Expand Down
Loading