Skip to content

Commit

Permalink
fix pool transition
Browse files Browse the repository at this point in the history
  • Loading branch information
yushih committed Jun 27, 2024
1 parent 20f020d commit 9bce51f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { PoolTransition } from '../../../../stores/toplevel/DelegationStore
type Props = {|
delegatedPool: PoolData,
+undelegate: void | (void => Promise<void>),
poolTransition?: PoolTransition,
poolTransition: ?PoolTransition,
delegateToSpecificPool: (id: ?string) => void,
|};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AllProps> {
static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = {
Expand All @@ -62,7 +58,7 @@ class StakingPageContent extends Component<AllProps> {

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());
}
Expand Down Expand Up @@ -243,7 +239,7 @@ class StakingPageContent extends Component<AllProps> {
if (!showRewardAmount) return undefined;
return currentlyDelegating
? maybe(delegatedUtxo, w => delegatedRewards.joinAddCopy(w))
: publicDeriver.getDefaultMultiToken();
: maybe(publicDeriver, w => w.getParent().getDefaultMultiToken());
})()}
graphData={generateGraphData({
publicDeriver,
Expand Down Expand Up @@ -354,7 +350,7 @@ class StakingPageContent extends Component<AllProps> {
);
}
}
export default (withLayout(StakingPageContent): ComponentType<Props>);
export default (withLayout(StakingPageContent): ComponentType<StoresAndActionsProps>);

const WrapperCards = styled(Box)({
display: 'flex',
Expand Down

0 comments on commit 9bce51f

Please sign in to comment.