Skip to content

Commit

Permalink
fix: close unbonding modal after successful request (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab authored Dec 18, 2024
1 parent f54c07f commit fd97b55
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/components/Delegations/Delegations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const Delegations = ({}) => {
});
};

// TODO: Hook up with unbonding modal
const handleUnbond = async (id: string) => {
try {
if (selectedDelegation?.stakingTxHashHex != id) {
Expand All @@ -107,7 +106,7 @@ export const Delegations = ({}) => {
// Sign the withdrawal transaction
const { stakingTx, finalityProviderPkHex, stakingValueSat } =
selectedDelegation;

setAwaitingWalletResponse(true);
await submitUnbondingTx(
{
stakingTimelock: stakingTx.timelock,
Expand All @@ -129,6 +128,11 @@ export const Delegations = ({}) => {
errorState: ErrorState.UNBONDING,
},
});
} finally {
setModalOpen(false);
setTxID("");
setModalMode(undefined);
setAwaitingWalletResponse(false);
}
};

Expand Down

0 comments on commit fd97b55

Please sign in to comment.