diff --git a/packages/yoroi-extension/app/api/ada/lib/cardanoCrypto/rustLoader.js b/packages/yoroi-extension/app/api/ada/lib/cardanoCrypto/rustLoader.js index 83fce2c638..287ce05544 100644 --- a/packages/yoroi-extension/app/api/ada/lib/cardanoCrypto/rustLoader.js +++ b/packages/yoroi-extension/app/api/ada/lib/cardanoCrypto/rustLoader.js @@ -227,7 +227,11 @@ class Module { * callback promise resolves. */ WasmScope(callback: Module => T): T { - return this.__WasmScopeInternal(callback).result; + const scopedResult = this.__WasmScopeInternal(callback); + if (scopedResult instanceof Promise) { + return scopedResult.then(r => r.result); + } + return scopedResult.result; } // Need to expose through a getter to get Flow to detect the type correctly