Skip to content

Commit d580e9c

Browse files
committed
fix(apps/client/src/pages/home.tsx): added support for Goerli(weird UX)
Bandada now supports only the Goerli network. If you try to use it on any other network, it will log an error. fix bandada-infra#288
1 parent 3b25790 commit d580e9c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/client/src/pages/home.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
isGroupMember
2626
} from "../utils/api"
2727

28-
const injectedConnector = new InjectedConnector({})
28+
const injectedConnector = new InjectedConnector({ supportedChainIds: [5] })
2929

3030
export default function HomePage(): JSX.Element {
3131
const [_inviteCode, setInviteCode] = useState<string>("")
@@ -141,6 +141,11 @@ export default function HomePage(): JSX.Element {
141141
[account, library]
142142
)
143143

144+
// Define the error handling function
145+
const handleError = (error: Error) => {
146+
console.error("Error during activation:", error)
147+
}
148+
144149
return (
145150
<Container maxW="container.md" pt="20" pb="20" px="8" centerContent>
146151
<VStack spacing="20" pb="30px" w="100%">
@@ -184,7 +189,7 @@ export default function HomePage(): JSX.Element {
184189
<Button
185190
colorScheme="secondary"
186191
variant="solid"
187-
onClick={() => activate(injectedConnector)}
192+
onClick={() => activate(injectedConnector, handleError)}
188193
>
189194
Connect Metamask
190195
</Button>

0 commit comments

Comments
 (0)