realtime.ts: Fix bug in emitOnlineUsers()

We incorrectly iterated over Map.keys() instead of Map.values()

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-05-31 21:38:42 +02:00
parent cb0f5c1bed
commit 5c4820483c
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

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