mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
fix reconnection for socket.io 1.x
This commit is contained in:
@@ -48,13 +48,12 @@ app.uid = null;
|
||||
socket.on('event:disconnect', function() {
|
||||
$(window).trigger('action:disconnected');
|
||||
app.isConnected = false;
|
||||
socket.socket.connect();
|
||||
socket.connect();
|
||||
});
|
||||
|
||||
socket.on('reconnecting', function (data, attempt) {
|
||||
socket.on('reconnecting', function (attempt) {
|
||||
if(attempt === parseInt(config.maxReconnectionAttempts, 10)) {
|
||||
socket.socket.reconnectionAttempts = 0;
|
||||
socket.socket.reconnectionDelay = config.reconnectionDelay;
|
||||
socket.io.attempts = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user