1
denis.karovic created
Hello,
There is an error with this component. If getting payment result is not succesfull after the first attempt and the method controlAgain() needs to be called, there is en error with loosing scope.
Wrong implementation:
controlAgain() {
if (this.maxControlCount === 0) {
return;
}
setTimeout(this.getPaymentResult, this.controlTimeout); // this makes it looses scope
this.controlTimeout *= 2;
this.maxControlCount--;
}
Appropriate Implementation:
controlAgain() {
if (this.maxControlCount === 0) {
return;
}
setTimeout( () => {
this.getPaymentResult();
}, this.controlTimeout); // this way scope is perserved
this.controlTimeout *= 2;
this.maxControlCount--;
}
2 Answer(s)
-
1
Thanks a lot @denis.karovic,
We will fix it. I have created an issue on https://github.com/aspnetzero/aspnet-zero-core/issues/3071
-
1
Thanks @denis.karovic. Changes in the dev branch. 2c6ffcc