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
+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();