Skip to content

Commit 68879d2

Browse files
authored
Fix minor typos
of wrong parameters passing order and wrong user object indexing in for each function
1 parent 4b419f4 commit 68879d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/realtime.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ function connection (socket) {
709709
return failConnection(404, 'note id not found', socket)
710710
}
711711

712-
if (isDuplicatedInSocketQueue(socket, connectionSocketQueue)) return
712+
if (isDuplicatedInSocketQueue(connectionSocketQueue, socket)) return
713713

714714
// store noteId in this socket session
715715
socket.noteId = noteId
@@ -723,8 +723,8 @@ function connection (socket) {
723723
var maxrandomcount = 10
724724
var found = false
725725
do {
726-
Object.keys(notes[noteId].users).forEach(function (user) {
727-
if (user.color === color) {
726+
Object.keys(notes[noteId].users).forEach(function (userId) {
727+
if (notes[noteId].users[userId].color === color) {
728728
found = true
729729
}
730730
})

0 commit comments

Comments
 (0)