You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
If someone init's the keyring twice, or calls updateTransportMethod twice quickly while the iframe is loading then you could run into situations where this if block runs (see here) but when this.delayedPromise.resolve(result) or this.delayedPromise.reject(e) is called the object is deleted by a separate execution context.
Ways that this could be fixed:
change this.delayedPromise to this.delayedPromises: Array<Object> = [], and then run something like:
for(constdelayedPromiseofthis.delayedPromises){this.updateTransportMethod(delayedPromise.transportType).then((res)=>delayedPromise.resolve(res)).catch(e=>delayedPromise.reject(e))}this.delayedPromises=[];// and then when the promise is added we do this.delayedPromises.push({// ...})
or, to allow for more flexibility, this.delayedPromise could be changed to something like this.iframeOnloadHooks: Array<Promise> and the whole this.updateTransportMethod could be contained in the array, in case someone needs to add in a different onload call in later?
The text was updated successfully, but these errors were encountered:
If someone
init
's the keyring twice, or callsupdateTransportMethod
twice quickly while the iframe is loading then you could run into situations where thisif
block runs (see here) but whenthis.delayedPromise.resolve(result)
orthis.delayedPromise.reject(e)
is called the object is deleted by a separate execution context.Ways that this could be fixed:
this.delayedPromise
tothis.delayedPromises: Array<Object> = []
, and then run something like:this.delayedPromise
could be changed to something likethis.iframeOnloadHooks: Array<Promise>
and the wholethis.updateTransportMethod
could be contained in the array, in case someone needs to add in a different onload call in later?The text was updated successfully, but these errors were encountered: