We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4b40d1 commit b54b3cbCopy full SHA for b54b3cb
2 files changed
lib/realtime.js
@@ -518,13 +518,16 @@ function disconnect(socket) {
518
var noteId = socket.noteId;
519
var note = notes[noteId];
520
if (note) {
521
+ // delete user in users
522
delete note.users[socket.id];
523
+ // remove sockets in the note socks
524
do {
525
var index = note.socks.indexOf(socket);
526
if (index != -1) {
527
note.socks.splice(index, 1);
528
}
529
} while (index != -1);
530
+ // remove note in notes if no user inside
531
if (Object.keys(note.users).length <= 0) {
532
if (note.server.isDirty) {
533
updateNote(note, function (err, _note) {
public/js/unused.js
0 commit comments