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 58bac3a commit 32f7a70
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 @@ -91,11 +91,6 @@ const TokenList = (props: Props) => {
return;
}

// Exclude tokens with no balance on source list
if (props.isSource && noBalance && props.wallet?.address) {
return;
}

// Exclude wormhole-wrapped tokens with no balance
// unless it's canonical
if (
Expand Down Expand Up @@ -163,11 +158,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 32f7a70

Please sign in to comment.