From 7e849c01395c9f08f00d359fea4f0dfbc9a1443d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Sim=C3=A3o?= Date: Mon, 6 Nov 2023 10:37:16 +0000 Subject: [PATCH] fix(Staking): limit parsing --- src/hooks/api/escrow/use-get-account-staking-data.tsx | 8 ++++++-- .../StakingAccountDetails/StakingAccountDetails.tsx | 5 ++++- .../StakingWithdrawCard/StakingWithdrawCard.tsx | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/hooks/api/escrow/use-get-account-staking-data.tsx b/src/hooks/api/escrow/use-get-account-staking-data.tsx index f8b6f405bf..289dd4b7f7 100644 --- a/src/hooks/api/escrow/use-get-account-staking-data.tsx +++ b/src/hooks/api/escrow/use-get-account-staking-data.tsx @@ -1,4 +1,4 @@ -import { CurrencyExt } from '@interlay/interbtc-api'; +import { CurrencyExt, newMonetaryAmount } from '@interlay/interbtc-api'; import { MonetaryAmount } from '@interlay/monetary-js'; import { AccountId } from '@polkadot/types/interfaces'; import Big from 'big.js'; @@ -7,6 +7,7 @@ import { useErrorHandler } from 'react-error-boundary'; import { useQuery } from 'react-query'; import { BLOCK_TIME } from '@/config/parachain'; +import { GOVERNANCE_TOKEN } from '@/config/relay-chains'; import { REFETCH_INTERVAL } from '@/utils/constants/api'; import useAccountId from '../../use-account-id'; @@ -61,6 +62,9 @@ const getAccountStakingData = async (accountId: AccountId): Promise { + onClaimRewards(); + setOpen(false); + } }); const handleSubmit = () => transaction.execute(); diff --git a/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx b/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx index a040934036..c6b8766717 100644 --- a/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx +++ b/src/pages/Staking/components/StakingWithdrawCard/StakingWithdrawCard.tsx @@ -23,7 +23,10 @@ const StakingWithdrawCard = ({ data, onWithdraw, ...props }: StakingWithdrawCard const [isOpen, setOpen] = useState(false); const transaction = useTransaction(Transaction.ESCROW_WITHDRAW, { - onSuccess: onWithdraw + onSuccess: () => { + onWithdraw(); + setOpen(false); + } }); const handleSubmit = () => transaction.execute();