diff --git a/packages/frontend/src/components/Swap/views/SwapPage.js b/packages/frontend/src/components/Swap/views/SwapPage.js index d548de4966..64ad584117 100644 --- a/packages/frontend/src/components/Swap/views/SwapPage.js +++ b/packages/frontend/src/components/Swap/views/SwapPage.js @@ -4,6 +4,7 @@ import { useDispatch } from 'react-redux'; import { useFetchByorSellUSN } from '../../../hooks/fetchByorSellUSN'; import { showCustomAlert } from '../../../redux/actions/status'; +import { actions as ledgerActions } from '../../../redux/slices/ledger'; import { fetchMultiplier } from '../../../redux/slices/multiplier'; import { formatTokenAmount } from '../../../utils/amounts'; import { formatNearAmount } from '../../common/balance/helpers'; @@ -15,6 +16,8 @@ import Loader from '../Loader'; import SwapInfoContainer from '../SwapInfoContainer'; import SwapTokenContainer from '../SwapTokenContainer'; +const { checkAndHideLedgerModal } = ledgerActions; + const balanceForError = (from) => { return from?.onChainFTMetadata?.symbol === 'NEAR' ? +formatNearAmount(from?.balance) @@ -53,6 +56,7 @@ const SwapPage = ({ setIsLoading(true); await fetchByOrSell(accountId, multiplier, slippageValue, +inputValueFrom, symbol, usnAmount); setActiveView('success'); + dispatch(checkAndHideLedgerModal()); } catch (e) { dispatch(showCustomAlert({ errorMessage: e.message,