summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-10-23 21:43:18 +0800
committerWu Cheng-Han2016-10-23 21:43:18 +0800
commita42845cfc02d6e4d5878e3e089804608fb863ada (patch)
tree7bbe9560bbfbf3886f218eb8615be20ca50046c9 /public/js
parent223c0726cdc2c074c1404fb2d26c1f5f7dbcee73 (diff)
Update to retry when anytime the socket io disconnect
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 47919d37..8080b9c7 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2308,11 +2308,9 @@ socket.on('delete', function () {
});
}
});
-var retryOnDisconnect = false;
var retryTimer = null;
socket.on('maintenance', function () {
cmClient.revision = -1;
- retryOnDisconnect = true;
});
socket.on('disconnect', function (data) {
showStatus(statusType.offline);
@@ -2322,7 +2320,7 @@ socket.on('disconnect', function (data) {
}
if (!editor.getOption('readOnly'))
editor.setOption('readOnly', true);
- if (retryOnDisconnect && !retryTimer) {
+ if (!retryTimer) {
retryTimer = setInterval(function () {
if (!needRefresh) socket.connect();
}, 1000);
@@ -2337,7 +2335,6 @@ socket.on('reconnect', function (data) {
socket.on('connect', function (data) {
clearInterval(retryTimer);
retryTimer = null;
- retryOnDisconnect = false;
personalInfo['id'] = socket.id;
showStatus(statusType.connected);
socket.emit('version');