This commit is contained in:
crusader 2017-08-14 13:26:06 +09:00
parent 9d43ba870b
commit 6012209413
2 changed files with 3 additions and 2 deletions

View File

@ -132,7 +132,7 @@ export default class WebSocketRPC {
private onResponseHandler(response: Response<ID_TYPE>): void { private onResponseHandler(response: Response<ID_TYPE>): void {
const requestID = response.ID; const requestID = response.ID;
const error = response.Error; const error = response.Error;
const result = JSON.parse(response.Result); const result = response.Result;
if (this.requestQueue.has(requestID)) { if (this.requestQueue.has(requestID)) {
let promise = this.requestQueue.get(requestID); let promise = this.requestQueue.get(requestID);

View File

@ -18,7 +18,7 @@ export class Response<ID> extends Header {
* get ID * get ID
*/ */
public get ID(): ID { public get ID(): ID {
return this.result; return this.id;
} }
/** /**
@ -41,6 +41,7 @@ export class Response<ID> extends Header {
throw new Error(`Response must include ID`); throw new Error(`Response must include ID`);
} }
let res = new Response(id); let res = new Response(id);
res.Protocol = response.protocol;
res.result = response.result; res.result = response.result;
res.error = response.error; res.error = response.error;
return res; return res;