Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
germartinez committed Sep 25, 2024
1 parent b675ed6 commit def7450
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Web3Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Web3AuthComponent() {
useEffect(() => {
const init = async () => {
try {
if (!CLIENT_ID) return
if (!CLIENT_ID || !web3auth) return

await web3auth.initModal()
const client = createWalletClient({
Expand All @@ -59,6 +59,8 @@ export default function Web3AuthComponent() {

const login = async () => {
try {
if (!web3auth) return

const web3authProvider = await web3auth.connect()
const client = createWalletClient({
chain: sepolia,
Expand All @@ -75,6 +77,8 @@ export default function Web3AuthComponent() {
}

const logout = async () => {
if (!web3auth) return

await web3auth.logout()

setProvider(null)
Expand Down

0 comments on commit def7450

Please sign in to comment.