Skip to content

Node.js based forum software built for the modern web

added index and fixed vote button in infinite scroll

barisusaklic62f251afc96
diff --git a/src/database/mongo.js b/src/database/mongo.js
index 455ef87190..58a1ea310f 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -90,6 +90,12 @@
}
});
+ db.collection('objects').ensureIndex({_key :1, score: 1}, {background:true}, function(err) {
+ if(err) {
+ winston.error('Error creating index ' + err.message);
+ }
+ });
+
db.collection('objects').ensureIndex({_key :1, value: -1}, {background:true}, function(err) {
if(err) {
winston.error('Error creating index ' + err.message);
diff --git a/src/socket.io/topics.js b/src/socket.io/topics.js
index 0b1c308bb8..2f09cbe68f 100644
--- a/src/socket.io/topics.js
+++ b/src/socket.io/topics.js
@@ -456,6 +456,9 @@ SocketTopics.loadMore = function(socket, data, callback) {
},
'reputation:disabled': function(next) {
next(null, parseInt(meta.config['reputation:disabled'], 10) === 1);
+ },
+ 'downvote:disabled': function(next) {
+ next(null, parseInt(meta.config['downvote:disabled'], 10) === 1);
}
}, callback);
});