mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
Add settings page to control watched categories (#6648)
* Add settings page to control watched categories * Fix passing undefined to pushUnreadCount
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
f5f3da12e7
commit
523a2dc54c
@@ -174,6 +174,8 @@ SocketCategories.ignore = function (socket, cid, callback) {
|
||||
};
|
||||
|
||||
function ignoreOrWatch(fn, socket, cid, callback) {
|
||||
var cids = [parseInt(cid, 10)];
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getSortedSetRange('categories:cid', 0, -1, next);
|
||||
@@ -187,10 +189,7 @@ function ignoreOrWatch(fn, socket, cid, callback) {
|
||||
c.parentCid = parseInt(c.parentCid, 10);
|
||||
});
|
||||
|
||||
var cids = [parseInt(cid, 10)];
|
||||
|
||||
// filter to subcategories of cid
|
||||
|
||||
var cat;
|
||||
do {
|
||||
cat = categoryData.find(function (c) {
|
||||
@@ -208,6 +207,9 @@ function ignoreOrWatch(fn, socket, cid, callback) {
|
||||
function (next) {
|
||||
topics.pushUnreadCount(socket.uid, next);
|
||||
},
|
||||
function (next) {
|
||||
next(null, cids);
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user