After reloading wallet address changed

Suppose i connect to metamsk then it shows metamask’s wallet address but if i reload the page then wallet address change from metamask to coinbase

I am reading acciunt from
const { account, chainId } = Moralis;

Can anyone please help me with this issue

useEffect(() => {

    if (isAuthenticated && !isWeb3Enabled && !isWeb3EnableLoading) enableWeb3();


    // eslint-disable-next-line react-hooks/exhaustive-deps

  }, [isAuthenticated, isWeb3Enabled, isInitialized]);

This code connect to last added web3 chrome extention so how to specify the provider in useEffect which we previously connected

you could try to read the ethAddress from current user to see if that has the value that you expect

or the issue is that you have 2 providers enabled and somehow you want to use one of them?

maybe you can ask the user to disconnect current provider if it is not the expected one

But when i do Moralis.executeFunction at that time it open wrong provider pop up

You can try using a custom connector for Coinbase Wallet similar to this example.

The issue is that MetaMask and Coinbase use the same injected connector by default so you will need to separate these out in some way.

Alternatively you could let the user handle this themselves - Coinbase gives the option to use either MetaMask or itself, or the user can disconnect the dapp when there’s a conflict like this.

Thanks I will try this