Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Nov 2, 2023
1 parent fe647b9 commit 0f5243a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions apps/connect/src/routes/token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { WormholeConnectConfig } from "@wormhole-foundation/wormhole-connec
import ConnectLoader from "../components/ConnectLoader";
import customTheme from "../theme/connect";
import mui from '../theme/portal';
import { useMemo } from "react";

const defaultConfig: WormholeConnectConfig = {
mode: mui.palette.mode,
Expand Down Expand Up @@ -40,12 +41,16 @@ export default function TokenBridge() {
const query = new URLSearchParams(window.location.search);
const txHash = query.get("txHash");
const sourceChain = query.get("sourceChain");
const config = {
...defaultConfig,
searchTx: {
txHash,
chainName: sourceChain,
},
}
const config = useMemo(() => {
if (txHash && sourceChain) {
return {
...defaultConfig,
txHash,
sourceChain,
};
} else {
return defaultConfig;
}
}, []);
return <ConnectLoader config={config} />;
}

0 comments on commit 0f5243a

Please sign in to comment.