Skip to content

Commit 0628779

Browse files
committed
Fix iterator for new Map data class
1 parent c557a67 commit 0628779

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/websockets/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ interface WSPayload {
2222
export const broadcast = (data: WSPayload) => {
2323
const payload = JSON.stringify(data)
2424

25-
Object.keys(webClients).forEach((userId) => {
26-
webClients.get(userId)?.send(payload)
25+
webClients.forEach(ws => {
26+
ws.send(payload)
2727
})
2828

29-
Object.keys(deviceClients).forEach((deviceId) => {
30-
deviceClients.get(deviceId)?.send(payload)
29+
deviceClients.forEach(ws => {
30+
ws.send(payload)
3131
})
3232
}
3333

0 commit comments

Comments
 (0)