Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 4001 is not thrown when closing the "install metamask" modal #1200

Open
ereynier opened this issue Jan 16, 2025 · 0 comments
Open

[Bug]: 4001 is not thrown when closing the "install metamask" modal #1200

ereynier opened this issue Jan 16, 2025 · 0 comments

Comments

@ereynier
Copy link

SDK

Web

Provide environment information

I use wagmi.sh with metamask connector, when I try to connect metamask while it's not installed, a modal with a link and a QR is shown. When I close it, nothing happens.

MetaMask SDK Version

0.31.4

MetaMask Mobile app Version

/

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

I have to reload the page if metamask is not installed and I close the modal with links.

Expected Behavior

Throw an error when the modal is closed

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

No response

To Reproduce

with wagmi.sh

"use client"
import { Button } from '@/components/ui/button'
import React, { useEffect } from 'react'
import { useAccount, useDisconnect } from 'wagmi'
import { useConnect } from 'wagmi'

const WalletButton = () => {


    const { connectors, connect, isPending } = useConnect()
    const { disconnect } = useDisconnect()
    const { isConnected } = useAccount()

    const handleConnect = () => {
        connect({ connector: connectors[0] })
    }



    return (
        (isConnected ? (
            <Button variant={'outline'} size={"sm"} onClick={() => disconnect()}>Disconnect</Button>
        ) : (
            <Button variant={'outline'} size={'sm'} disabled={isPending} onClick={handleConnect}>{isPending ? "Connecting..." : "Metamask"}</Button>
        )
        )
    )
}

export default WalletButton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant