fix failing to send peaks data when connecting

This commit is contained in:
Nick Krecklow 2020-03-30 00:48:47 -05:00
parent f1fe9d02e4
commit a458038075
No known key found for this signature in database
GPG Key ID: 5F149FDE156FFA94

4
app.js

@ -21,7 +21,7 @@ var networkVersions = [];
var graphData = [];
var highestPlayerCount = {};
var lastGraphPush = [];
var graphPeaks = [];
var graphPeaks = {};
function pingAll() {
for (var i = 0; i < servers.length; i++) {
@ -251,7 +251,7 @@ function startServices() {
client.emit('historyGraph', graphData);
// Send current peaks, if any
if (graphPeaks.length > 0) {
if (Object.keys(graphPeaks).length > 0) {
client.emit('peaks', graphPeaks);
}
}