From aaa5491896362150594c98306ed4a8fa5267ee44 Mon Sep 17 00:00:00 2001 From: tjs Date: Tue, 5 Apr 2022 02:20:17 -0400 Subject: [PATCH] make sure token info is loaded on swap page --- components/SwapTokenSelect.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/SwapTokenSelect.tsx b/components/SwapTokenSelect.tsx index 147a801a..f22d2249 100644 --- a/components/SwapTokenSelect.tsx +++ b/components/SwapTokenSelect.tsx @@ -94,9 +94,13 @@ const SwapTokenSelect = ({ }, []) const tokenInfos = useMemo(() => { - return sortedTokenMints.filter((token) => { - return !token?.name || !token?.symbol ? false : true - }) + if (sortedTokenMints?.length) { + return sortedTokenMints.filter((token) => { + return !token?.name || !token?.symbol ? false : true + }) + } else { + return [] + } }, [sortedTokenMints]) const handleUpdateSearch = (e) => {