mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
Add more comments in the code and remove unused code file
This commit is contained in:
parent
e4b40d11a2
commit
b54b3cbe69
2 changed files with 3 additions and 45 deletions
|
@ -518,13 +518,16 @@ function disconnect(socket) {
|
|||
var noteId = socket.noteId;
|
||||
var note = notes[noteId];
|
||||
if (note) {
|
||||
// delete user in users
|
||||
delete note.users[socket.id];
|
||||
// remove sockets in the note socks
|
||||
do {
|
||||
var index = note.socks.indexOf(socket);
|
||||
if (index != -1) {
|
||||
note.socks.splice(index, 1);
|
||||
}
|
||||
} while (index != -1);
|
||||
// remove note in notes if no user inside
|
||||
if (Object.keys(note.users).length <= 0) {
|
||||
if (note.server.isDirty) {
|
||||
updateNote(note, function (err, _note) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue