diff --git a/src/context/assets.tsx b/src/context/assets.tsx index d67659b3..7c15f86b 100644 --- a/src/context/assets.tsx +++ b/src/context/assets.tsx @@ -1,5 +1,5 @@ import { Asset, FeeAsset } from "@skip-router/core"; -import { createContext, ReactNode, useCallback, useContext, useEffect, useMemo } from "react"; +import { createContext, ReactNode, useCallback, useContext, useMemo } from "react"; import { useChains } from "@/hooks/useChains"; import { sortFeeAssets } from "@/utils/chain"; @@ -89,20 +89,20 @@ export function AssetsProvider({ children }: { children: ReactNode }) { const isReady = useMemo(() => Object.keys(assets).length > 0, [assets]); - useEffect(() => { - if (!isReady || !chains || !assets) return; - const load = (src: string) => { - const img = new Image(); - img.src = src; - img.onload = () => img.remove(); - }; - chains.forEach(({ chainID, logoURI }) => { - logoURI && load(logoURI); - (assets[chainID] || []).forEach(({ logoURI }) => { - logoURI && load(logoURI); - }); - }); - }, [assets, chains, isReady]); + // useEffect(() => { + // if (!isReady || !chains || !assets) return; + // const load = (src: string) => { + // const img = new Image(); + // img.src = src; + // img.onload = () => img.remove(); + // }; + // chains.forEach(({ chainID, logoURI }) => { + // logoURI && load(logoURI); + // (assets[chainID] || []).forEach(({ logoURI }) => { + // logoURI && load(logoURI); + // }); + // }); + // }, [assets, chains, isReady]); return ( { + return Object.fromEntries( + Object.entries(assets).map(([chainID, chainAssets]) => { + return [ + chainID, + chainAssets.filter((asset) => { + return !(asset.denom === "solana-devnet-native" || asset.denom === "solana-native"); + }), + ]; + }), + ); + }, }); }