From d3e94ea72fea464783daefba268fdce4689c53b3 Mon Sep 17 00:00:00 2001 From: sebipap Date: Thu, 28 Sep 2023 16:41:14 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20always=20use=20optimism?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/getEXA/SelectRoute.tsx | 2 +- contexts/GetEXAContext.tsx | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/getEXA/SelectRoute.tsx b/components/getEXA/SelectRoute.tsx index 86c50a344..237c60835 100644 --- a/components/getEXA/SelectRoute.tsx +++ b/components/getEXA/SelectRoute.tsx @@ -64,7 +64,7 @@ const SelectRoute = () => { {t('Network')}: - + {chain && ( diff --git a/contexts/GetEXAContext.tsx b/contexts/GetEXAContext.tsx index 3be793641..1d96f1940 100644 --- a/contexts/GetEXAContext.tsx +++ b/contexts/GetEXAContext.tsx @@ -22,7 +22,7 @@ import { } from 'viem'; import * as wagmiChains from 'wagmi/chains'; -import { useNetwork, useSignTypedData, useWalletClient } from 'wagmi'; +import { useSignTypedData, useWalletClient } from 'wagmi'; import { optimism } from 'wagmi/chains'; import { @@ -129,7 +129,7 @@ export const GetEXAProvider: FC = ({ children }) => { const [activeRoutes, setActiveRoutes] = useState(); const [bridgeStatus, setBridgeStatus] = useState(); - const { chain: activeChain } = useNetwork(); + // const { chain: activeChain } = useNetwork(); const { walletAddress, opts, chain: appChain } = useWeb3(); const { data: walletClient } = useWalletClient({ chainId: chain?.chainId }); @@ -235,8 +235,7 @@ export const GetEXAProvider: FC = ({ children }) => { setTX({ status: status ? 'success' : 'error', hash: transactionHash }); } } - setTXStep(TXStep.CONFIRM); - } + setTXStep(TXStep.CONFIRM); } catch (err) { setTXError({ message: t('Error approving token'), status: true }); } @@ -282,7 +281,7 @@ export const GetEXAProvider: FC = ({ children }) => { }).then(splitSignature); const permit = { - owner: walletAddress, + // owner: walletAddress, value, deadline, ...{ v, r: r as Hex, s: s as Hex }, @@ -532,10 +531,10 @@ export const GetEXAProvider: FC = ({ children }) => { useEffect(() => { if (!chains) return; - const id = activeChain?.id || optimism.id; + const id = optimism.id; const activeNetwork = chains.find(({ chainId }) => chainId === id); if (activeNetwork) setChain(activeNetwork); - }, [activeChain?.id, chains, setChain]); + }, [chains, setChain]); useEffect(() => { setAsset(chainAssets[0]);