From cc356620d89539d7bc1b0be5249696325bd448c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Sim=C3=A3o?= Date: Tue, 14 Nov 2023 10:38:33 +0000 Subject: [PATCH] fix(Staking): close modal on submit --- .../StakingAccountDetails/StakingAccountDetails.tsx | 6 ++++-- .../components/StakingWithdrawCard/StakingWithdrawCard.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/Staking/components/StakingAccountDetails/StakingAccountDetails.tsx b/src/pages/Staking/components/StakingAccountDetails/StakingAccountDetails.tsx index 170a209e1..f89f9047e 100644 --- a/src/pages/Staking/components/StakingAccountDetails/StakingAccountDetails.tsx +++ b/src/pages/Staking/components/StakingAccountDetails/StakingAccountDetails.tsx @@ -31,11 +31,13 @@ const StakingAccountDetails = ({ const transaction = useTransaction(Transaction.ESCROW_WITHDRAW_REWARDS, { onSuccess: () => { onClaimRewards(); - setOpen(false); } }); - const handleSubmit = () => transaction.execute(); + const handleSubmit = () => { + transaction.execute(); + setOpen(false); + }; const handleOpen = () => transaction.fee.estimate(); diff --git a/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx b/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx index c6b876671..49f8ec108 100644 --- a/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx +++ b/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx @@ -25,11 +25,13 @@ const StakingWithdrawCard = ({ data, onWithdraw, ...props }: StakingWithdrawCard const transaction = useTransaction(Transaction.ESCROW_WITHDRAW, { onSuccess: () => { onWithdraw(); - setOpen(false); } }); - const handleSubmit = () => transaction.execute(); + const handleSubmit = () => { + transaction.execute(); + setOpen(false); + }; const handleOpen = () => transaction.fee.estimate();