From 2d14eb0480c7aa884ade022514772b0b57d86b2c Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 5 Dec 2023 16:43:39 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-110595=20fix:=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5-=E5=88=A0=E9=99=A4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/decision.api.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 7301526..1963071 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -91,11 +91,7 @@ export class DecisionApi implements Api { } getSocketStatus(): boolean { - if (Dec) { - return Dec.socket.connected; - } - - return false; + return !!Dec?.socket?.connected; } isDriverError(errorCode: string) { @@ -122,7 +118,7 @@ export class DecisionApi implements Api { private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { - if (Dec && Dec.socket.connected) { + if (Dec?.socket?.connected) { Dec.socketEmit(type, BI.encode(name), (re: any) => { resolve(re); });