diff --git a/frontend/nextjs/emt.config.ts b/frontend/nextjs/emt.config.ts index bbcd451..c448231 100644 --- a/frontend/nextjs/emt.config.ts +++ b/frontend/nextjs/emt.config.ts @@ -29,9 +29,10 @@ import { HOME_PAGE } from "@/app/(with wallet)/_components/page-links"; const oldMobileGetUri = old.mobile!.getUri; old.mobile!.getUri = async () => { if(window?.ethereum){ + alert('eth') return oldMobileGetUri as any } - return 'metamask.app.link/dapp/'+location.host+HOME_PAGE + return 'https://metamask.app.link/dapp/'+location.origin+HOME_PAGE } return old } diff --git a/frontend/nextjs/src/lib/hooks/useContracts.tsx b/frontend/nextjs/src/lib/hooks/useContracts.tsx index b2acd4d..bbeed66 100644 --- a/frontend/nextjs/src/lib/hooks/useContracts.tsx +++ b/frontend/nextjs/src/lib/hooks/useContracts.tsx @@ -147,18 +147,18 @@ export function ContractProvider({ children }: { children: React.ReactNode }) { }, [ethereum, chain.id, account.address, network?.chain?.id]); useEffect(() => { - if (network?.chain?.id !== chain.id) { + if (network.chain && network.chain.id !== chain.id) { toast({ title: "Wrong Network", - description: "Please change to the topos network", + description: "Please change to the Topos network", variant: "destructive", }) setWrongNetwork(true); } else { - if (wrongNetwork) { + if (network.chain && wrongNetwork) { toast({ title: "Network Changed", - description: "You have successfully changed to the topos network", + description: "You have successfully changed to the Topos network", variant: "success", }) setWrongNetwork(false);