MetaMask / MetaMask/detect-provider

(WARNING) MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.

Open
#40 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
238
Forks
63
PR merge metrics
No merged PRs in 30d

Description

The code:

 useEffect(() => {
        const loadProvider =async () => { 
            const provider = await detectEthereumProvider()

            if (provider) {
                const web3 = new Web3(provider);

                setWeb3Api({
                    provider: provider,
                    web3: web3,
                    contract: null,
                    isLoading: false
                });

            } else {
                setWeb3Api({
                    ...web3Api,
                    isLoading: false
                });
                console.error('Please install MetaMask!')
            }
        }  
        loadProvider();
    }, [])

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the MetaMask warning with the provider-loading useEffect shown in the issue, then trace where the deprecated close event is registered. Confirm the replacement behavior with the provider event handling and verify that the warning is gone while disconnect handling still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.