diff --git a/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/DelegatedStakePoolCard.js b/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/DelegatedStakePoolCard.js index d516636d98..89a09b1b57 100644 --- a/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/DelegatedStakePoolCard.js +++ b/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/DelegatedStakePoolCard.js @@ -14,7 +14,7 @@ import type { PoolTransition } from '../../../../stores/toplevel/DelegationStore type Props = {| delegatedPool: PoolData, +undelegate: void | (void => Promise), - poolTransition?: PoolTransition, + poolTransition: ?PoolTransition, delegateToSpecificPool: (id: ?string) => void, |}; diff --git a/packages/yoroi-extension/app/containers/wallet/staking/StakingPageContent.js b/packages/yoroi-extension/app/containers/wallet/staking/StakingPageContent.js index 02ac52606c..232b5c99d0 100644 --- a/packages/yoroi-extension/app/containers/wallet/staking/StakingPageContent.js +++ b/packages/yoroi-extension/app/containers/wallet/staking/StakingPageContent.js @@ -34,16 +34,12 @@ import { compose, maybe, noop } from '../../../coreUtils'; // populated by ConfigWebpackPlugin declare var CONFIG: ConfigType; -type Props = {| - ...StoresAndActionsProps, - actions: any, - stores: any, -|}; + type InjectedLayoutProps = {| +renderLayoutComponent: LayoutComponentMap => Node, |}; -type AllProps = {| ...Props, ...InjectedLayoutProps |}; +type AllProps = {| ...StoresAndActionsProps, ...InjectedLayoutProps |}; @observer class StakingPageContent extends Component { static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { @@ -62,7 +58,7 @@ class StakingPageContent extends Component { if (this.props.stores.delegation.getPoolTransitionConfig(publicDeriver).shouldUpdatePool) { const poolTransitionInfo = this.props.stores.delegation.getPoolTransitionInfo(publicDeriver); - if (poolTransitionInfo) { + if (poolTransitionInfo?.suggestedPool) { this.props.stores.delegation.delegateToSpecificPool(poolTransitionInfo.suggestedPool.hash); noop(this.props.stores.delegation.createDelegationTransaction()); } @@ -243,7 +239,7 @@ class StakingPageContent extends Component { if (!showRewardAmount) return undefined; return currentlyDelegating ? maybe(delegatedUtxo, w => delegatedRewards.joinAddCopy(w)) - : publicDeriver.getDefaultMultiToken(); + : maybe(publicDeriver, w => w.getParent().getDefaultMultiToken()); })()} graphData={generateGraphData({ publicDeriver, @@ -354,7 +350,7 @@ class StakingPageContent extends Component { ); } } -export default (withLayout(StakingPageContent): ComponentType); +export default (withLayout(StakingPageContent): ComponentType); const WrapperCards = styled(Box)({ display: 'flex',