From df9ce3116980792eaf61e15a4758113ff5043a4c Mon Sep 17 00:00:00 2001 From: Emre Bogazliyanlioglu Date: Mon, 23 Sep 2024 18:05:17 +0300 Subject: [PATCH] [Redesign] Exclude Frankenstein tokens when no wallet connected Signed-off-by: Emre Bogazliyanlioglu --- .../views/v2/Bridge/AssetPicker/TokenList.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/wormhole-connect/src/views/v2/Bridge/AssetPicker/TokenList.tsx b/wormhole-connect/src/views/v2/Bridge/AssetPicker/TokenList.tsx index 205876a2f..7cd443cac 100644 --- a/wormhole-connect/src/views/v2/Bridge/AssetPicker/TokenList.tsx +++ b/wormhole-connect/src/views/v2/Bridge/AssetPicker/TokenList.tsx @@ -86,11 +86,6 @@ const TokenList = (props: Props) => { return; } - // Exclude tokens with no balance on source list - if (props.isSource && !balance && props.wallet?.address) { - return; - } - // Exclude wormhole-wrapped tokens with no balance if ( props.isSource && @@ -156,11 +151,14 @@ const TokenList = (props: Props) => { } }); - // Finally: If no wallet is connected, fill up any remaining space from supported tokens - if (!props.wallet?.address) { + // Finally: If this is destination token or no wallet is connected, + // fill up any remaining space from supported and non-Frankenstein tokens + if (!props.isSource || !props.wallet?.address) { props.tokenList?.forEach((t) => { - // Adding remaining tokens - if (!tokenSet.has(t.key)) { + if ( + !tokenSet.has(t.key) && + !isFrankensteinToken(t, selectedChainConfig.key) + ) { addToken(t); } });