mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
Update realtime check and refresh event, compress data using LZString UTF16 to minimize network delay
This commit is contained in:
parent
f49fc192f6
commit
67474aa1d4
2 changed files with 9 additions and 2 deletions
|
@ -69,6 +69,7 @@ function emitCheck(note) {
|
|||
authors: note.authors,
|
||||
authorship: note.authorship
|
||||
};
|
||||
out = LZString.compressToUTF16(JSON.stringify(out));
|
||||
realtime.io.to(note.id).emit('check', out);
|
||||
}
|
||||
|
||||
|
@ -310,7 +311,7 @@ function emitRefresh(socket) {
|
|||
var noteId = socket.noteId;
|
||||
if (!noteId || !notes[noteId]) return;
|
||||
var note = notes[noteId];
|
||||
socket.emit('refresh', {
|
||||
var out = {
|
||||
docmaxlength: config.documentmaxlength,
|
||||
owner: note.owner,
|
||||
ownerprofile: note.ownerprofile,
|
||||
|
@ -321,7 +322,9 @@ function emitRefresh(socket) {
|
|||
permission: note.permission,
|
||||
createtime: note.createtime,
|
||||
updatetime: note.updatetime
|
||||
});
|
||||
};
|
||||
out = LZString.compressToUTF16(JSON.stringify(out));
|
||||
socket.emit('refresh', out);
|
||||
}
|
||||
|
||||
function clearSocketQueue(queue, socket) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue