From fd97b550c87ca971bcb0f0ac6c2477eefef2e52e Mon Sep 17 00:00:00 2001 From: Crypto Minion <154598612+jrwbabylonlab@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:31:32 +1100 Subject: [PATCH] fix: close unbonding modal after successful request (#522) --- src/app/components/Delegations/Delegations.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/components/Delegations/Delegations.tsx b/src/app/components/Delegations/Delegations.tsx index 6396852c..204deb5a 100644 --- a/src/app/components/Delegations/Delegations.tsx +++ b/src/app/components/Delegations/Delegations.tsx @@ -98,7 +98,6 @@ export const Delegations = ({}) => { }); }; - // TODO: Hook up with unbonding modal const handleUnbond = async (id: string) => { try { if (selectedDelegation?.stakingTxHashHex != id) { @@ -107,7 +106,7 @@ export const Delegations = ({}) => { // Sign the withdrawal transaction const { stakingTx, finalityProviderPkHex, stakingValueSat } = selectedDelegation; - + setAwaitingWalletResponse(true); await submitUnbondingTx( { stakingTimelock: stakingTx.timelock, @@ -129,6 +128,11 @@ export const Delegations = ({}) => { errorState: ErrorState.UNBONDING, }, }); + } finally { + setModalOpen(false); + setTxID(""); + setModalMode(undefined); + setAwaitingWalletResponse(false); } };