Skip to content

Commit

Permalink
[Redesign] Exclude Frankenstein tokens when no wallet connected
Browse files Browse the repository at this point in the history
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
  • Loading branch information
emreboga committed Sep 24, 2024
1 parent caa5d8e commit df9ce31
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions wormhole-connect/src/views/v2/Bridge/AssetPicker/TokenList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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);
}
});
Expand Down

0 comments on commit df9ce31

Please sign in to comment.