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); }