Skip to content

Commit d4804f7

Browse files
committed
Fix user color is not following the author color
1 parent a14e795 commit d4804f7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/realtime.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ function finishConnection(socket, note, user) {
368368
return failConnection(403, 'connection forbidden', socket);
369369
}
370370
}
371+
// update user color to author color
372+
if (note.authors[user.userid]) {
373+
user.color = users[socket.id].color = note.authors[user.userid].color;
374+
}
371375
note.users[socket.id] = user;
372376
note.socks.push(socket);
373377
note.server.addClient(socket);

0 commit comments

Comments
 (0)