Mobile metamask does not work on dapp site

Viewed 764

There is a website with a built-in dapp. There are two buttons: {account info} and {contract info}. When you click on the first button, the code implies loading addresses and balance through window.ethereum.request({ method: "eth_requestAccounts" }) and window.ethereum.request({ method: "eth_getBalance", params: [selectedAccount] }). On the computer it works great: image1

But on mobile metamask browser not working (button is not pressed): image2

Second button works fine both on computer and mobile (contains vanilla text without functions). Earlier I used web3.js and with functions that loaded when loading the page was not problems. Now, I use window.ethereum and think the problem can be from the window onload, with whom I do not know how to contact. Hook provider:

const provider = await detectEthereumProvider()

  if (provider) {
    web3 = new Web3(window.ethereum);
    document.getElementById("status_connect").innerHTML = ""
  } else {
    document.querySelector("#status_wallet").style.display = "block";
  }

I do not know what the problem is, tell me, please

0 Answers
Related