Skip to content

Commit

Permalink
fix asset selector 2
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Aug 30, 2024
1 parent 9bc7358 commit a0e21cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/token/AssetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ export function AssetSelector(props: AssetSelectorProps) {
});
}

const selectedAssetKey = selectedAsset
let selectedAssetKey = selectedAsset
? assets?.findIndex((asset) => asset.address === selectedAsset.address) || 0
: 0;

if (assets && selectedAssetKey === -1) {
selectedAssetKey = 0;
onAssetChange(assets[selectedAssetKey]);
}

return (
<Dropdown
select={selectedAssetKey}
Expand Down

0 comments on commit a0e21cf

Please sign in to comment.