isConnected to dApp browsers like metamask
HosseinAsadi opened this issue · comments
Hi there
I want to check that my pwa dapp is connect to any dApp browsers like metamask or not
so i have below code
final eth = window.ethereum;
if (eth != null)
eth!.isConnected();
but this always return true!!
do you have suggestion for me?
Good catch, I've fixed this in 3adef15.
I am using the latest version but it still returns true! :(
web3dart 2.1.4
I've just published version 2.2.0 which contains the fix.
thank you so much
Hi there
I want to check that my pwa dapp is connect to any dApp browsers like metamask or not
so i have below code
final eth = window.ethereum;
if (eth != null)
eth!.isConnected();but this always return true!!
do you have suggestion for me?
It still is!!
@simolus3
I can't reproduce this. We have this example:
web3dart/example/metamask/web/main.dart
Lines 9 to 13 in 4edbfd7
When I run dart pub global webdev serve
, it prints "MetaMask is not available" in a browser without metamask and opens the pop-up for browsers that have the plugin installed.
no no
I did not mean that!
if (eth != null)
eth!.isConnected();
isConnected()
What is the task of this?
because this function always return true with eth != null !!
In fact, I want to check to see do my dApp is connect to the metamask or not
for example if not connect, I call
eth!.requestAccount();