Skip to content

Commit

Permalink
fix: handle invalid image paths in manage token page
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Nov 11, 2024
1 parent b55d049 commit 777c52c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import ManageTokenSearch from '@components/pages/manage-token/manage-token';
import useAppNavigate from '@hooks/use-app-navigate';
import { useCurrentAccount } from '@hooks/use-current-account';
import { useTokenBalance } from '@hooks/use-token-balance';
import { useTokenMetainfo } from '@hooks/use-token-metainfo';
import { ManageTokenInfo, RoutePath } from '@types';

const ManageTokenSearchContainer: React.FC = () => {
const { navigate, goBack } = useAppNavigate();
const [searchKeyword, setSearchKeyword] = useState('');
const [isClose, setIsClose] = useState(false);
const { currentAccount } = useCurrentAccount();
const { tokenLogoMap } = useTokenMetainfo();
const { currentBalances, toggleDisplayOption } = useTokenBalance();

useEffect(() => {
Expand All @@ -39,11 +41,11 @@ const ManageTokenSearchContainer: React.FC = () => {
value: BigNumber(metainfo.amount.value).toFormat(),
denom: metainfo.amount.denom,
},
logo: metainfo.image || `${UnknownTokenIcon}`,
logo: tokenLogoMap[metainfo.tokenId] || `${UnknownTokenIcon}`,
};
});
return filteredTokens;
}, [searchKeyword, currentBalances]);
}, [searchKeyword, currentBalances, tokenLogoMap]);

const moveTokenAddedPage = useCallback(() => {
navigate(RoutePath.ManageTokenAdded);
Expand Down

0 comments on commit 777c52c

Please sign in to comment.