From ed65d8bd7b8f8ab04eac5a30fe0a149a3a032383 Mon Sep 17 00:00:00 2001 From: gitwoz <177856586+gitwoz@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:00:07 +0700 Subject: [PATCH] feat(vault): refresh balance after USDT withdrawal --- .../Dialogs/WithdrawVaultUSDTDialog/Confirming.tsx | 14 ++++++++++++-- .../WithdrewLockedTokensNotice.tsx | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/Dialogs/WithdrawVaultUSDTDialog/Confirming.tsx b/src/components/Dialogs/WithdrawVaultUSDTDialog/Confirming.tsx index 28daf94486..ab91d4938c 100644 --- a/src/components/Dialogs/WithdrawVaultUSDTDialog/Confirming.tsx +++ b/src/components/Dialogs/WithdrawVaultUSDTDialog/Confirming.tsx @@ -5,7 +5,14 @@ import { FormattedMessage } from 'react-intl' import { OPEN_WITHDRAW_VAULT_USDT_DIALOG, PATHS } from '~/common/enums' import { formatAmount, truncate } from '~/common/utils' -import { Dialog, Spinner, toast, useRoute, ViewerContext } from '~/components' +import { + Dialog, + Spinner, + toast, + useRoute, + useVaultBalanceUSDT, + ViewerContext, +} from '~/components' import { TransactionState, WithdrawVaultUsdtMutation, @@ -47,9 +54,10 @@ const WITHDRAW_VAULT_USDT_POLLING = gql` ` const Confirming: React.FC = ({ amount, closeDialog }) => { + const { router } = useRoute() const viewer = useContext(ViewerContext) const address = viewer.info.ethAddress! - const { router } = useRoute() + const { refetch: refetchVaultBalanceUSDT } = useVaultBalanceUSDT() const [withdraw] = useMutation(WITHDRAW_VAULT_USDT) const [txId, setTxId] = useState(null) @@ -103,6 +111,8 @@ const Confirming: React.FC = ({ amount, closeDialog }) => { ], }) + refetchVaultBalanceUSDT() + closeDialog() } diff --git a/src/components/Notice/TransactionNotice/WithdrewLockedTokensNotice.tsx b/src/components/Notice/TransactionNotice/WithdrewLockedTokensNotice.tsx index da9722d63b..d19f0fd762 100644 --- a/src/components/Notice/TransactionNotice/WithdrewLockedTokensNotice.tsx +++ b/src/components/Notice/TransactionNotice/WithdrewLockedTokensNotice.tsx @@ -39,7 +39,7 @@ const WithdrewLockedTokensNotice = ({ data-test-id={TEST_ID.NOTICE_WITHDREW_LOCKED_TOKENS} >
- + {isFailed ? (