From 6012209413a5fa59432722fb571f39961d9cc8b5 Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 14 Aug 2017 13:26:06 +0900 Subject: [PATCH] bug fix --- src/ts/@overflow/commons/websocket/WebSocketRPC.ts | 2 +- src/ts/@overflow/commons/websocket/protocol/Response.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ts/@overflow/commons/websocket/WebSocketRPC.ts b/src/ts/@overflow/commons/websocket/WebSocketRPC.ts index 5edd904..23387ed 100644 --- a/src/ts/@overflow/commons/websocket/WebSocketRPC.ts +++ b/src/ts/@overflow/commons/websocket/WebSocketRPC.ts @@ -132,7 +132,7 @@ export default class WebSocketRPC { private onResponseHandler(response: Response): void { const requestID = response.ID; const error = response.Error; - const result = JSON.parse(response.Result); + const result = response.Result; if (this.requestQueue.has(requestID)) { let promise = this.requestQueue.get(requestID); diff --git a/src/ts/@overflow/commons/websocket/protocol/Response.ts b/src/ts/@overflow/commons/websocket/protocol/Response.ts index 67f9d2e..b812ea1 100644 --- a/src/ts/@overflow/commons/websocket/protocol/Response.ts +++ b/src/ts/@overflow/commons/websocket/protocol/Response.ts @@ -18,7 +18,7 @@ export class Response extends Header { * get ID */ public get ID(): ID { - return this.result; + return this.id; } /** @@ -41,6 +41,7 @@ export class Response extends Header { throw new Error(`Response must include ID`); } let res = new Response(id); + res.Protocol = response.protocol; res.result = response.result; res.error = response.error; return res;