Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"connect" and "disconect" events #5

Open
MakarPustovalov opened this issue Mar 6, 2023 · 1 comment
Open

"connect" and "disconect" events #5

MakarPustovalov opened this issue Mar 6, 2023 · 1 comment

Comments

@MakarPustovalov
Copy link

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).
image

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).
image
image

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.

@lvshaoping007
Copy link
Collaborator

Why not determine the connection status directly through window.mina.requestAccounts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants