Lazy crypto init (#4709)

This commit is contained in:
Jaco
2022-03-31 16:45:09 +03:00
committed by GitHub
parent 756f817d93
commit bb0b365dfe
2 changed files with 5 additions and 6 deletions
+1
View File
@@ -12,6 +12,7 @@ Changes:
- Cater for `DispatchError` with `error` as `[u8; 4]`
- Add in-flight cache for parallel same-version metadata queries
- Cater for lazy `@polkadot/util-crypto` init (adjustment for React Native)
## 7.14.3 Mar 28, 2022
+4 -6
View File
@@ -391,12 +391,10 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this.emit('connected');
try {
const [hasMeta, cryptoReady] = await Promise.all([
this._loadMeta(),
this._options.initWasm === false
? Promise.resolve(true)
: cryptoWaitReady()
]);
const cryptoReady = this._options.initWasm === false
? true
: await cryptoWaitReady();
const hasMeta = await this._loadMeta();
this._subscribeHealth();