Skip to content

Commit b54b3cb

Browse files
committed
Add more comments in the code and remove unused code file
1 parent e4b40d1 commit b54b3cb

2 files changed

Lines changed: 3 additions & 45 deletions

File tree

lib/realtime.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,16 @@ function disconnect(socket) {
518518
var noteId = socket.noteId;
519519
var note = notes[noteId];
520520
if (note) {
521+
// delete user in users
521522
delete note.users[socket.id];
523+
// remove sockets in the note socks
522524
do {
523525
var index = note.socks.indexOf(socket);
524526
if (index != -1) {
525527
note.socks.splice(index, 1);
526528
}
527529
} while (index != -1);
530+
// remove note in notes if no user inside
528531
if (Object.keys(note.users).length <= 0) {
529532
if (note.server.isDirty) {
530533
updateNote(note, function (err, _note) {

public/js/unused.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)