From 67f7f48ca060cf9648536aab9ff68540bace4e22 Mon Sep 17 00:00:00 2001 From: marcinbodnar Date: Fri, 18 Feb 2022 21:20:00 +0100 Subject: [PATCH] fix: finding targetToken --- packages/frontend/src/components/send/SendContainerV2.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/components/send/SendContainerV2.js b/packages/frontend/src/components/send/SendContainerV2.js index 56cb6763f6..0418b10fe9 100644 --- a/packages/frontend/src/components/send/SendContainerV2.js +++ b/packages/frontend/src/components/send/SendContainerV2.js @@ -106,9 +106,11 @@ const SendContainerV2 = ({ useEffect(() => { // fungibleTokens contains balance data for each token -- we need to update local state every time it changes // TODO: Add a `byIdentity` reducer for faster lookups than .find() - const targetToken = fungibleTokens.find(({ contractName, onChainFTMetadata }) => { - return (contractName && contractName === selectedToken.contractName) || onChainFTMetadata?.symbol === selectedToken.onChainFTMetadata?.symbol; - }); + let targetToken = fungibleTokens.find(({ contractName }) => + (contractName && contractName === selectedToken.contractName) + ) || fungibleTokens.find(({ onChainFTMetadata }) => + onChainFTMetadata?.symbol === selectedToken.onChainFTMetadata?.symbol + ); setSelectedToken(targetToken); }, [fungibleTokens]);