From 1f714303c570046a19fe6380f3bc6f1af9a4ff4a Mon Sep 17 00:00:00 2001 From: Harsh R <53080940+fullstackninja864@users.noreply.github.com> Date: Fri, 20 Oct 2023 10:57:21 +0530 Subject: [PATCH] fix(ui-ux): fixed Send screen displays no assets displayed issue (#4088) * fix(ui-ux): fixed Send screen displays no assets displayed issue * updated token listing condition --- mobile-app/app/contexts/EVMProvider.tsx | 2 +- .../AppNavigator/screens/Portfolio/hooks/EvmTokenBalances.ts | 2 +- .../AppNavigator/screens/Portfolio/screens/SendScreen.tsx | 2 +- .../screens/Portfolio/screens/TokenSelectionScreen.tsx | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mobile-app/app/contexts/EVMProvider.tsx b/mobile-app/app/contexts/EVMProvider.tsx index c43ae38e66..91ca10dd2f 100644 --- a/mobile-app/app/contexts/EVMProvider.tsx +++ b/mobile-app/app/contexts/EVMProvider.tsx @@ -44,7 +44,7 @@ export function EVMProvider({ useEffect(() => { getProvider(); - }, [ethRpcUrl]); + }, [network, ethRpcUrl]); const client = useMemo( () => ({ diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/hooks/EvmTokenBalances.ts b/mobile-app/app/screens/AppNavigator/screens/Portfolio/hooks/EvmTokenBalances.ts index 600b7d8133..a69cb8574d 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/hooks/EvmTokenBalances.ts +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/hooks/EvmTokenBalances.ts @@ -112,7 +112,7 @@ export function useEvmTokenBalances(): { evmTokens: WalletToken[] } { ); }); } - }, [network, evmAddress, blockCount, isFocused]); + }, [network, evmAddress, blockCount, isFocused, provider]); useEffect(() => { setAllTokensWithAddress( diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/SendScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/SendScreen.tsx index 72c924ae96..f0b2546d53 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/SendScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/SendScreen.tsx @@ -244,7 +244,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { setToken({ ...t, amount: - t.displaySymbol === "DFI" + t.displaySymbol === "DFI" && t.id !== "0_evm" ? BigNumber.max( new BigNumber(t.amount).minus(reservedDFI), 0, diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/TokenSelectionScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/TokenSelectionScreen.tsx index 780e3af56a..2d492a3d0d 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/TokenSelectionScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/TokenSelectionScreen.tsx @@ -320,11 +320,12 @@ function getTokensWithBalance( tokens.forEach((t) => { const available = new BigNumber( - t.displaySymbol === "DFI" + t.displaySymbol === "DFI" && t.id !== "0_evm" ? new BigNumber(t.amount).minus(reservedFees).toFixed(8) : t.amount, ); - if (available.isLessThan(0) || t.id === "0" || t.id === "0_utxo") { + + if (available.isLessThanOrEqualTo(0) || t.id === "0" || t.id === "0_utxo") { return; }