mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-15 23:21:39 +02:00
fix: filter disabled categories on user categories page count
This commit is contained in:
@@ -49,7 +49,9 @@ module.exports = function (User) {
|
||||
if (!(parseInt(uid, 10) > 0)) {
|
||||
return [];
|
||||
}
|
||||
const cids = await User.getCategoriesByStates(uid, [categories.watchStates.watching]);
|
||||
let cids = await User.getCategoriesByStates(uid, [categories.watchStates.watching]);
|
||||
const categoryData = await categories.getCategoriesFields(cids, ['disabled']);
|
||||
cids = cids.filter((cid, index) => categoryData[index] && !categoryData[index].disabled);
|
||||
const result = await plugins.hooks.fire('filter:user.getWatchedCategories', {
|
||||
uid: uid,
|
||||
cids: cids,
|
||||
|
||||
Reference in New Issue
Block a user