forked from mystiq/hydrogen-web
Merge pull request #713 from vector-im/bwindels/fix-request-responsecode-error
fix error thrown during request when response code is not used
This commit is contained in:
commit
c9bc080aef
1 changed files with 3 additions and 3 deletions
|
@ -27,8 +27,8 @@ class Request implements IHomeServerRequest {
|
||||||
public readonly args: any[];
|
public readonly args: any[];
|
||||||
private responseResolve: (result: any) => void;
|
private responseResolve: (result: any) => void;
|
||||||
public responseReject: (error: Error) => void;
|
public responseReject: (error: Error) => void;
|
||||||
private responseCodeResolve: (result: any) => void;
|
private responseCodeResolve?: (result: any) => void;
|
||||||
private responseCodeReject: (result: any) => void;
|
private responseCodeReject?: (result: any) => void;
|
||||||
private _requestResult?: IHomeServerRequest;
|
private _requestResult?: IHomeServerRequest;
|
||||||
private readonly _responsePromise: Promise<any>;
|
private readonly _responsePromise: Promise<any>;
|
||||||
private _responseCodePromise: Promise<any>;
|
private _responseCodePromise: Promise<any>;
|
||||||
|
@ -73,7 +73,7 @@ class Request implements IHomeServerRequest {
|
||||||
const response = await this._requestResult?.response();
|
const response = await this._requestResult?.response();
|
||||||
this.responseResolve(response);
|
this.responseResolve(response);
|
||||||
const responseCode = await this._requestResult?.responseCode();
|
const responseCode = await this._requestResult?.responseCode();
|
||||||
this.responseCodeResolve(responseCode);
|
this.responseCodeResolve?.(responseCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
get requestResult() {
|
get requestResult() {
|
||||||
|
|
Loading…
Reference in a new issue