*add a _timeoutCanceled property and abort handeTimeout if true

This commit is contained in:
Derrick Hammer 2022-09-18 16:01:51 -04:00
parent c841b45013
commit 309b9b0ac6
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@ export default abstract class RpcQueryBase {
protected _promise?: Promise<any>;
protected _timeoutTimer?: any;
protected _timeout: boolean = false;
protected _timeoutCanceled: boolean = false;
protected _completed: boolean = false;
protected _responses: { [relay: string]: RPCResponse } = {};
protected _errors: { [relay: string]: any } = {};
@ -34,6 +35,9 @@ export default abstract class RpcQueryBase {
}
private handeTimeout() {
if (this._timeoutCanceled) {
return;
}
this.resolve(undefined, true);
}