From 77e905d6487becee8f74653c079fc280a076a36d Mon Sep 17 00:00:00 2001 From: Branko Bosnic Date: Mon, 26 Feb 2024 14:56:39 +0100 Subject: [PATCH] fix: show validator tab if account has staking feature --- .github/workflows/nova-build-temp.yaml | 2 +- .../section/AddressPageTabbedSections.tsx | 8 ++--- .../nova/hooks/useAccountAddressState.ts | 33 ++++++++++++++----- setup_nova.sh | 2 +- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/nova-build-temp.yaml b/.github/workflows/nova-build-temp.yaml index 3d5ef83f6..ed00fb84f 100644 --- a/.github/workflows/nova-build-temp.yaml +++ b/.github/workflows/nova-build-temp.yaml @@ -6,7 +6,7 @@ on: TARGET_COMMIT: description: "Target Commit Hash for the SDK" required: false - default: "56b19d4c12c1bf23bc716b47c36018d37d5b3168" + default: "aa1b1de58731dbbf9dd0f5e2960fd11b0056b633" environment: type: choice description: "Select the environment to deploy to" diff --git a/client/src/app/components/nova/address/section/AddressPageTabbedSections.tsx b/client/src/app/components/nova/address/section/AddressPageTabbedSections.tsx index ca9c5f2ea..a2b9644a3 100644 --- a/client/src/app/components/nova/address/section/AddressPageTabbedSections.tsx +++ b/client/src/app/components/nova/address/section/AddressPageTabbedSections.tsx @@ -77,7 +77,7 @@ const buildAccountAddressTabsOptions = ( isBlockIssuer: boolean, isCongestionLoading: boolean, foundriesCount: number, - hasValidatorDetails: boolean, + hasStakingFeature: boolean, isAccountFoundriesLoading: boolean, isValidatorDetailsLoading: boolean, ) => ({ @@ -94,8 +94,8 @@ const buildAccountAddressTabsOptions = ( infoContent: bicMessage, }, [ACCOUNT_TABS.Validation]: { - disabled: !hasValidatorDetails, - hidden: !hasValidatorDetails, + disabled: !hasStakingFeature, + hidden: !hasStakingFeature, isLoading: isValidatorDetailsLoading, infoContent: validatorMessage, }, @@ -201,7 +201,7 @@ export const AddressPageTabbedSections: React.FC feature.type === FeatureType.BlockIssuer, - ) as BlockIssuerFeature; - if (blockIssuerFeature) { - updatedState = { - ...updatedState, - blockIssuerFeature, - }; + if (accountOutput) { + if (!state.blockIssuerFeature) { + const blockIssuerFeature = accountOutput?.features?.find( + (feature) => feature.type === FeatureType.BlockIssuer, + ) as BlockIssuerFeature; + if (blockIssuerFeature) { + updatedState = { + ...updatedState, + blockIssuerFeature, + }; + } + } + if (!state.stakingFeature) { + const stakingFeature = accountOutput?.features?.find((feature) => feature.type === FeatureType.Staking) as StakingFeature; + if (stakingFeature) { + updatedState = { + ...updatedState, + stakingFeature, + }; + } } } diff --git a/setup_nova.sh b/setup_nova.sh index d036a032a..adc14bd82 100755 --- a/setup_nova.sh +++ b/setup_nova.sh @@ -1,6 +1,6 @@ #!/bin/bash SDK_DIR="iota-sdk" -TARGET_COMMIT="56b19d4c12c1bf23bc716b47c36018d37d5b3168" +TARGET_COMMIT="aa1b1de58731dbbf9dd0f5e2960fd11b0056b633" if [ ! -d "$SDK_DIR" ]; then git clone -b 2.0 git@github.com:iotaledger/iota-sdk.git