From 4db31be7e3597fc5815601c125d085a153feed9a Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 19 Oct 2014 15:59:33 -0400 Subject: [PATCH] #2200 actually fix dupe colors, show 10 topics --- public/src/admin/general/dashboard.js | 2 +- src/socket.io/meta.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/src/admin/general/dashboard.js b/public/src/admin/general/dashboard.js index c2bd8c704b..d0a631c4ea 100644 --- a/public/src/admin/general/dashboard.js +++ b/public/src/admin/general/dashboard.js @@ -367,7 +367,7 @@ define('admin/general/dashboard', ['semver'], function(semver) { var tid = segments[i].tid; if ($.inArray(tid, tids) === -1) { - usedTopicColors.splice($.inArray(segments[i].color, usedTopicColors), 1); + usedTopicColors.splice($.inArray(segments[i].fillColor, usedTopicColors), 1); graphs.topics.removeData(i); } else { graphs.topics.segments[i].value = topics[tid].value; diff --git a/src/socket.io/meta.js b/src/socket.io/meta.js index 6ccda3dd8d..2eee30bab3 100644 --- a/src/socket.io/meta.js +++ b/src/socket.io/meta.js @@ -125,9 +125,12 @@ SocketMeta.rooms.getAll = function(socket, data, callback) { topTenTopics = topTenTopics.concat(scores[mostActive.pop()]); } - topTenTopics = topTenTopics.slice(0,9); + topTenTopics = topTenTopics.slice(0, 10); topics.getTopicsFields(topTenTopics, ['title'], function(err, titles) { + if (err) { + return callback(err); + } topTenTopics.forEach(function(tid, id) { socketData.topics[tid] = { value: rooms['/topic_' + tid].length,