From 349f254a84576ca1b84af4959d6839534e7a6a61 Mon Sep 17 00:00:00 2001 From: MickWang <1244134672@qq.com> Date: Wed, 7 Aug 2024 16:29:24 +0800 Subject: [PATCH] fix: nova points error --- src/components/Bridge/index.tsx | 3 ++- src/hooks/useTokenList.ts | 8 +++++++- vite.config.ts | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/Bridge/index.tsx b/src/components/Bridge/index.tsx index fe2868c8..084bad5d 100644 --- a/src/components/Bridge/index.tsx +++ b/src/components/Bridge/index.tsx @@ -286,7 +286,8 @@ export default function Bridge(props: IBridgeComponentProps) { const priceInfo = allTokens.find( (item) => item.symbol.toLowerCase() === - tokenFiltered[tokenActive].symbol.toLowerCase() + tokenFiltered[tokenActive].symbol.toLowerCase() && + item.networkKey === fromList[fromActive].networkKey ); const ethPriceInfo = allTokens.find((item) => item.symbol === "ETH"); // const [priceInfo, ethPriceInfo] = await Promise.all([ diff --git a/src/hooks/useTokenList.ts b/src/hooks/useTokenList.ts index 1fc8edf1..8990ee7b 100644 --- a/src/hooks/useTokenList.ts +++ b/src/hooks/useTokenList.ts @@ -53,7 +53,13 @@ export const useTokenBalanceList = () => { const { networkKey } = useBridgeNetworkStore(); const { address: walletAddress } = useAccount(); const [allTokens, setAllTokens] = useState< - { l1Address: string; iconURL: string; usdPrice: number; symbol: string }[] + { + l1Address: string; + iconURL: string; + usdPrice: number; + symbol: string; + networkKey: string; + }[] >([]); useEffect(() => { diff --git a/vite.config.ts b/vite.config.ts index 9bc30499..80419bc0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -47,8 +47,8 @@ export default defineConfig({ port: 3001, proxy: { "/app-api": { - target: "https://goerli.app.zklink.io", - // target: "https://app-api.zklink.io", + // target: "https://goerli.app.zklink.io", + target: "https://app-api.zklink.io", changeOrigin: true, rewrite: (path) => path.replace(/^\/app-api/, ""), },