Browse Source

Pull request #8564: REPORT-110595 fix: socket相关内容加个容错

Merge in DEC/decision-webui-dcm from ~AUSTIN.DUAN/decision-webui-dcm:research/11.0 to research/11.0

* commit '2d14eb0480c7aa884ade022514772b0b57d86b2c':
  REPORT-110595 fix: 数据连接-删除数据连接失败
research/11.0
Austin.Duan-段嗣跃 12 months ago
parent
commit
62064baa0f
  1. 8
      src/modules/crud/decision.api.ts

8
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<SocketResult> {
return new Promise(resolve => {
if (Dec && Dec.socket.connected) {
if (Dec?.socket?.connected) {
Dec.socketEmit(type, BI.encode(name), (re: any) => {
resolve(re);
});

Loading…
Cancel
Save