Hey, guys. In the process of developing my application I had a problem. It seems that the events "connect" and "disconect" described in the code are never called by provider, so there is no direct way to track connection and disconnection of wallet (only if you use event accountsChanged, which doesn't help the situation much).
The private method onConnect() is never called, so the connectFlag is left undefined, which breaks isConnected() method.
For this reason the method isConnected() does not work, always returning undefined value (although according to the type description, a Boolean variable is expected in the output).
Also, because of this problem, it is impossible to track whether a wallet is initially connected to app without calling the "mina.requestAccounts()" method, which is undesirable in many cases.
Hey, guys. In the process of developing my application I had a problem. It seems that the events "connect" and "disconect" described in the code are never called by provider, so there is no direct way to track connection and disconnection of wallet (only if you use event
accountsChanged
, which doesn't help the situation much).The private method
onConnect()
is never called, so theconnectFlag
is left undefined, which breaksisConnected()
method. For this reason the methodisConnected()
does not work, always returning undefined value (although according to the type description, a Boolean variable is expected in the output).Also, because of this problem, it is impossible to track whether a wallet is initially connected to app without calling the "mina.requestAccounts()" method, which is undesirable in many cases.