diff --git a/web/src/app.tsx b/web/src/app.tsx
index 4b16279dc..741b9392d 100644
--- a/web/src/app.tsx
+++ b/web/src/app.tsx
@@ -18,6 +18,7 @@ import Courts from "./pages/Courts";
import DisputeTemplateView from "./pages/DisputeTemplateView";
import DisputeResolver from "./pages/Resolver";
import GetPnk from "./pages/GetPnk";
+import { LifiProvider } from "./context/LiFiProvider";
const App: React.FC = () => {
return (
@@ -28,18 +29,20 @@ const App: React.FC = () => {
-
- }>
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯} />
-
-
+
+
+ }>
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯} />
+
+
+
diff --git a/web/src/context/LiFiProvider.tsx b/web/src/context/LiFiProvider.tsx
index 52a4c8f71..012b43a1e 100644
--- a/web/src/context/LiFiProvider.tsx
+++ b/web/src/context/LiFiProvider.tsx
@@ -66,16 +66,18 @@ export const LifiProvider: React.FC<{ children: React.ReactNode }> = ({ children
const signer = useEthersSigner({ chainId: swapData.fromChainId });
const routeRequest = useMemo(() => constructRouteRequest(swapData), [swapData]);
+ const lifi = useMemo(
+ () =>
+ new LiFi({
+ integrator: "Kleros",
+ apiUrl: "https://staging.li.quest/v1",
+ }),
+ []
+ );
const resetRoutes = () => {
setSelectedRoute(undefined);
setRoutes([]);
};
-
- const lifi = new LiFi({
- integrator: "Kleros",
- apiUrl: "https://staging.li.quest/v1",
- });
-
// update tokens for the chain
useEffect(() => {
resetRoutes();
@@ -93,7 +95,7 @@ export const LifiProvider: React.FC<{ children: React.ReactNode }> = ({ children
.getTokenBalance(address, fromToken)
.then((res) => setSwapData({ ...swapData, tokenBalance: res?.amount }))
.catch((err) => console.log("Error fetching token balance: ", { err }));
- }, [swapData.fromToken, address, tokens, swapData.fromTokenAddress]);
+ }, [swapData.fromToken, address, tokens, swapData.fromTokenAddress, lifi]);
useDebounce(
() => {
@@ -138,7 +140,7 @@ export const LifiProvider: React.FC<{ children: React.ReactNode }> = ({ children
return { status: false };
})
.finally(() => setIsExecuting(false));
- }, [routes, signer]);
+ }, [routes, signer, lifi]);
return (
{
const [settingsOpen, toggleSettings] = useToggle(false);
return (
-
+ <>
@@ -40,7 +39,7 @@ const GetPnk: React.FC = () => {
{settingsOpen ? : }
-
+ >
);
};