mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
Change to raise socket io reconnection attempts and make editor only available after refresh event received
This commit is contained in:
parent
70a52e2eae
commit
e097622098
1 changed files with 4 additions and 4 deletions
|
@ -2262,7 +2262,8 @@ window.havePermission = havePermission;
|
|||
var io = require("socket.io-client");
|
||||
var socket = io.connect({
|
||||
path: urlpath ? '/' + urlpath + '/socket.io/' : '',
|
||||
timeout: 5000 //5 secs to timeout
|
||||
timeout: 5000, //5 secs to timeout,
|
||||
reconnectionAttempts: 20 // retry 20 times on connect failed
|
||||
});
|
||||
//overwrite original event for checking login state
|
||||
var on = socket.on;
|
||||
|
@ -2636,6 +2637,8 @@ socket.on('refresh', function (data) {
|
|||
scrollToHash();
|
||||
}, 1);
|
||||
}
|
||||
if (editor.getOption('readOnly'))
|
||||
editor.setOption('readOnly', false);
|
||||
});
|
||||
|
||||
var EditorClient = ot.EditorClient;
|
||||
|
@ -2689,9 +2692,6 @@ socket.on('doc', function (obj) {
|
|||
updateView();
|
||||
}
|
||||
|
||||
if (editor.getOption('readOnly'))
|
||||
editor.setOption('readOnly', false);
|
||||
|
||||
restoreInfo();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue