Skip to content

Commit

Permalink
fix: unbonding or transition button should be hidden after unboning r…
Browse files Browse the repository at this point in the history
…equested (#532)
  • Loading branch information
jrwbabylonlab authored Dec 20, 2024
1 parent 9aa456d commit 0f6a232
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/app/components/Delegations/DelegationActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const DelegationActions: React.FC<DelegationActionsProps> = ({
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);

// We no longer show the transition button when the unbonding transaction is pending
if (intermediateState === DelegationState.INTERMEDIATE_UNBONDING) {
return null;
}

// Unbonded
if (state === DelegationState.UNBONDED) {
return (
Expand All @@ -48,11 +53,7 @@ export const DelegationActions: React.FC<DelegationActionsProps> = ({
}

// Active, eligible for transition
if (
state === DelegationState.ACTIVE ||
isEligibleForTransition ||
state === DelegationState.WITHDRAWN
) {
if (state === DelegationState.ACTIVE || isEligibleForTransition) {
return (
<div
className="flex justify-end lg:justify-start"
Expand Down
2 changes: 2 additions & 0 deletions src/utils/getState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const getStateTooltip = (state: string) => {
switch (state) {
case DelegationState.ACTIVE: // active state is shwon
return "Stake is active";
case DelegationState.UNBONDING_REQUESTED:
return "Stake is requesting unbonding";
case DelegationState.UNBONDED:
return "Stake has been unbonded";
case DelegationState.WITHDRAWN:
Expand Down

0 comments on commit 0f6a232

Please sign in to comment.