Skip to content

Commit

Permalink
fix: users should be able to buy assets not supported by their wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenfurniture committed Nov 13, 2024
1 parent 74ed692 commit aed507b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ export const AssetChainDropdown: React.FC<AssetChainDropdownProps> = memo(
const renderedChains = useMemo(() => {
if (!assetId) return null
return filteredRelatedAssetIds.map(relatedAssetId => {
const isSupported = wallet && isAssetSupportedByWallet(relatedAssetId, wallet)
const isSupported =
!onlyConnectedChains || (wallet && isAssetSupportedByWallet(relatedAssetId, wallet))

return (
<MenuItemOption value={relatedAssetId} key={relatedAssetId} isDisabled={!isSupported}>
<AssetChainRow assetId={relatedAssetId} mainImplementationAssetId={assetId} />
</MenuItemOption>
)
})
}, [assetId, filteredRelatedAssetIds, wallet])
}, [assetId, filteredRelatedAssetIds, onlyConnectedChains, wallet])

const handleChangeAsset = useCallback(
(value: string | string[]) => {
Expand Down

0 comments on commit aed507b

Please sign in to comment.