aptos-labs / wallet-adapter-plugin-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Race condition in wallet detection

piotr-layerzero opened this issue · comments

If adapter is instantiated before the extension plugin is injected then the wallet is not detected correctly.
Calling adapter.connect() results in WalletType Address Info Error error to be thrown.
A solution to this is implement polling mechanism with sane timeout.

How to replicate: https://codesandbox.io/s/sharp-shaw-xvhll2?file=/index.html