From 64ebcad7fccc8962bd4cc5b36717413eb7b552df Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 17 Jul 2025 14:07:21 +0200 Subject: [PATCH] wsid cannot be undefined --- src/services/wsService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/wsService.ts b/src/services/wsService.ts index 7421bc10..1b49ae3e 100644 --- a/src/services/wsService.ts +++ b/src/services/wsService.ts @@ -43,7 +43,7 @@ export const stopWsServers = (promises: Promise[]): void => { let lastWsid: number = 0; interface IWsCustomData extends ws { - id?: number; + id: number; accountId?: string; } @@ -187,7 +187,7 @@ export const sendWsBroadcastEx = (data: IWsMsgToClient, accountId?: string, excl for (const client of wsServer.clients) { if ( (!accountId || (client as IWsCustomData).accountId == accountId) && - (!excludeWsid || (client as IWsCustomData).id != excludeWsid) + (client as IWsCustomData).id != excludeWsid ) { client.send(msg); } @@ -197,7 +197,7 @@ export const sendWsBroadcastEx = (data: IWsMsgToClient, accountId?: string, excl for (const client of wssServer.clients) { if ( (!accountId || (client as IWsCustomData).accountId == accountId) && - (!excludeWsid || (client as IWsCustomData).id != excludeWsid) + (client as IWsCustomData).id != excludeWsid ) { client.send(msg); }