Skip to content

Commit

Permalink
🩹 always use optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
sebipap committed Sep 28, 2023
1 parent ab8b1d8 commit d3e94ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/getEXA/SelectRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const SelectRoute = () => {
<Typography fontSize={14} fontWeight={500}>
{t('Network')}:
</Typography>
<ChainSelector disabled={!walletAddress} />
<ChainSelector disabled />
</Box>
{chain && (
<Box ml="auto" display="flex" alignItems="center" gap={1} fontSize="14px">
Expand Down
13 changes: 6 additions & 7 deletions contexts/GetEXAContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -129,7 +129,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
const [activeRoutes, setActiveRoutes] = useState<ContextValues['activeRoutes']>();
const [bridgeStatus, setBridgeStatus] = useState<ContextValues['bridgeStatus']>();

const { chain: activeChain } = useNetwork();
// const { chain: activeChain } = useNetwork();
const { walletAddress, opts, chain: appChain } = useWeb3();

const { data: walletClient } = useWalletClient({ chainId: chain?.chainId });
Expand Down Expand Up @@ -235,8 +235,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
setTX({ status: status ? 'success' : 'error', hash: transactionHash });
}
}
setTXStep(TXStep.CONFIRM);
}
setTXStep(TXStep.CONFIRM);
} catch (err) {
setTXError({ message: t('Error approving token'), status: true });
}
Expand Down Expand Up @@ -282,7 +281,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
}).then(splitSignature);

const permit = {
owner: walletAddress,
// owner: walletAddress,
value,
deadline,
...{ v, r: r as Hex, s: s as Hex },
Expand Down Expand Up @@ -532,10 +531,10 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ 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]);
Expand Down

0 comments on commit d3e94ea

Please sign in to comment.