From 5c4820483c4c249a74977b626b79a511269e58f8 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 31 May 2020 21:38:42 +0200 Subject: [PATCH] realtime.ts: Fix bug in emitOnlineUsers() We incorrectly iterated over Map.keys() instead of Map.values() Signed-off-by: David Mehren --- src/lib/realtime.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/realtime.ts b/src/lib/realtime.ts index 5b733d934..98ab8c895 100644 --- a/src/lib/realtime.ts +++ b/src/lib/realtime.ts @@ -349,8 +349,7 @@ function emitOnlineUsers (socket: SocketWithNoteId): void { const note = notes.get(noteId) if (!note) return const users: UserSession[] = [] - // Object.keys(note.users).forEach(function (key) { - for (const user of note.users.keys()) { + for (const user of note.users.values()) { if (user) { users.push(buildUserOutData(user)) }