Skip to content

Commit

Permalink
feat: On the Explorer, the default network overrides the URL (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
voenkomatiwe authored Feb 13, 2024
1 parent 23efcae commit 9475e29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions explorer/src/providers/network-provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { FC, PropsWithChildren, useCallback, useState } from "react";
import { useLoaderData, useLocation, useNavigate } from "react-router-dom";
import { useAccount, useNetwork } from "wagmi";

import { defaultChain } from "@/config";
import { INetwork } from "@/interfaces/config";

import { NetworkContext } from "./context";
Expand All @@ -18,7 +17,7 @@ export const NetworkContextProvider: FC<PropsWithChildren> = ({ children }): JSX
const retrievedNetwork = useLoaderData() as INetwork;

const [network, setNetwork] = useState<INetwork>(retrievedNetwork);
const [sdk, setSdk] = useState<VeraxSdk>(new VeraxSdk(defaultChain.veraxEnv));
const [sdk, setSdk] = useState<VeraxSdk>(new VeraxSdk(network.veraxEnv));

const switchUserNetwork = useCallback(
async (pendingChain: Chain, currentChainId?: number) => {
Expand Down

0 comments on commit 9475e29

Please sign in to comment.