mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
closes #1288
This commit is contained in:
@@ -9,10 +9,7 @@ var socket,
|
|||||||
'isFocused': true,
|
'isFocused': true,
|
||||||
'currentRoom': null,
|
'currentRoom': null,
|
||||||
'widgets': {}
|
'widgets': {}
|
||||||
},
|
};
|
||||||
|
|
||||||
MAX_RECONNECTION_ATTEMPTS = 5,
|
|
||||||
RECONNECTION_DELAY = 200;
|
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var showWelcomeMessage = false;
|
var showWelcomeMessage = false;
|
||||||
@@ -32,8 +29,8 @@ var socket,
|
|||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
socket = io.connect('', {
|
socket = io.connect('', {
|
||||||
'max reconnection attempts': MAX_RECONNECTION_ATTEMPTS,
|
'max reconnection attempts': config.maxReconnectionAttempts,
|
||||||
'reconnection delay': RECONNECTION_DELAY,
|
'reconnection delay': config.reconnectionDelay,
|
||||||
resource: RELATIVE_PATH.length ? RELATIVE_PATH.slice(1) + '/socket.io' : 'socket.io'
|
resource: RELATIVE_PATH.length ? RELATIVE_PATH.slice(1) + '/socket.io' : 'socket.io'
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -112,9 +109,9 @@ var socket,
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('reconnecting', function (data, attempt) {
|
socket.on('reconnecting', function (data, attempt) {
|
||||||
if(attempt === MAX_RECONNECTION_ATTEMPTS) {
|
if(attempt === config.maxReconnectionAttempts) {
|
||||||
socket.socket.reconnectionAttempts = 0;
|
socket.socket.reconnectionAttempts = 0;
|
||||||
socket.socket.reconnectionDelay = RECONNECTION_DELAY;
|
socket.socket.reconnectionDelay = config.reconnectionDelay;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ apiController.getConfig = function(req, res, next) {
|
|||||||
config.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;
|
config.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;
|
||||||
config.usePagination = parseInt(meta.config.usePagination, 10) === 1;
|
config.usePagination = parseInt(meta.config.usePagination, 10) === 1;
|
||||||
config.disableSocialButtons = parseInt(meta.config.disableSocialButtons, 10) === 1;
|
config.disableSocialButtons = parseInt(meta.config.disableSocialButtons, 10) === 1;
|
||||||
|
config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5;
|
||||||
|
config.reconnectionDelay = meta.config.reconnectionDelay || 200;
|
||||||
config.topicsPerPage = meta.config.topicsPerPage || 20;
|
config.topicsPerPage = meta.config.topicsPerPage || 20;
|
||||||
config.postsPerPage = meta.config.postsPerPage || 20;
|
config.postsPerPage = meta.config.postsPerPage || 20;
|
||||||
config.maximumFileSize = meta.config.maximumFileSize;
|
config.maximumFileSize = meta.config.maximumFileSize;
|
||||||
|
|||||||
Reference in New Issue
Block a user