The reason of using EMS was related to some issues loading and injecting the polkadot extension in the window object, looks like there was a tiny delay between extension-inject loading the extension and extension-dapp requesting the injection status (win.injectedWeb3)
There is an optional parameter in the web3Enable method, added an array of functions returning a promise, the promise will run before the checks on isWeb3Injected adding some milliseconds to await the extension to be injected.
Another option is checking the web3Enable output and if there is no extensions loaded run a retry, this adds extra code and i decided to use the the existing optional parameter from web3Enable call.
The reason of using EMS was related to some issues loading and injecting the polkadot
extension
in thewindow
object, looks like there was a tiny delay betweenextension-inject
loading the extension andextension-dapp
requesting the injection status (win.injectedWeb3)There is an optional parameter in the
web3Enable
method, added an array of functions returning a promise, the promise will run before the checks onisWeb3Injected
adding some milliseconds to await the extension to be injected.Another option is checking the
web3Enable
output and if there is no extensions loaded run a retry, this adds extra code and i decided to use the the existing optional parameter fromweb3Enable
call.https://github.com/subspace/subspace.js/blob/4d3acfd2cb0dc7e82039cd25812182bb74896dfa/src/identity.ts#L32-L37
_Originally posted by @1devNdogs in https://github.com/subspace/subspace.js/pull/5#discussion_r772223504_