Skip to content

Commit

Permalink
Attempt_2 (#56)
Browse files Browse the repository at this point in the history
* Jovells workflow auto sync after pr merge (#4)

* Update main.yml

* Update main.yml

* Fix_Attempt_2
  • Loading branch information
Jovells authored Dec 24, 2023
1 parent 80558ca commit cc8e5b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion frontend/nextjs/emt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/nextjs/src/lib/hooks/useContracts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cc8e5b9

Please sign in to comment.