mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-12 04:02:27 +02:00
don't attempt to update graphs if we're not connected
This commit is contained in:
@@ -17,7 +17,7 @@ define('forum/admin/general/dashboard', ['semver'], function(semver) {
|
||||
clearInterval(updateIntervalId);
|
||||
}
|
||||
updateIntervalId = setInterval(function() {
|
||||
if (app.isFocused) {
|
||||
if (app.isFocused && app.isConnected) {
|
||||
socket.emit('meta.rooms.getAll', Admin.updateRoomUsage);
|
||||
}
|
||||
}, 5000);
|
||||
@@ -305,10 +305,10 @@ define('forum/admin/general/dashboard', ['semver'], function(semver) {
|
||||
}
|
||||
|
||||
function updateTrafficGraph() {
|
||||
if (!app.isFocused) {
|
||||
if (!app.isFocused || !app.isConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
socket.emit('admin.analytics.get', {graph: "traffic"}, function (err, data) {
|
||||
for (var i = 0, ii = data.pageviews.length; i < ii; i++) {
|
||||
graphs.traffic.datasets[0].points[i].value = data.pageviews[i];
|
||||
|
||||
Reference in New Issue
Block a user