mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
fixed #3355
fixed issue where disabled categories showed up in the category dropdown in /unread
This commit is contained in:
@@ -156,7 +156,7 @@ var async = require('async'),
|
||||
}
|
||||
|
||||
category.name = validator.escape(category.name);
|
||||
category.disabled = parseInt(category.disabled, 10) === 1;
|
||||
category.disabled = category.hasOwnProperty('disabled') ? parseInt(category.disabled, 10) === 1 : undefined;
|
||||
category.icon = category.icon || 'hidden';
|
||||
if (category.hasOwnProperty('post_count')) {
|
||||
category.post_count = category.totalPostCount = category.post_count || 0;
|
||||
|
||||
@@ -30,11 +30,11 @@ unreadController.unread = function(req, res, next) {
|
||||
},
|
||||
function(_results, next) {
|
||||
results = _results;
|
||||
categories.getMultipleCategoryFields(results.watchedCategories, ['cid', 'name', 'slug', 'icon', 'link'], next);
|
||||
categories.getMultipleCategoryFields(results.watchedCategories, ['cid', 'name', 'slug', 'icon', 'link', 'disabled'], next);
|
||||
},
|
||||
function(categories, next) {
|
||||
categories = categories.filter(function(category) {
|
||||
return category && !category.link;
|
||||
return category && !category.link && !category.disabled;
|
||||
});
|
||||
categories.forEach(function(category) {
|
||||
category.selected = parseInt(category.cid, 10) === parseInt(cid, 10);
|
||||
|
||||
Reference in New Issue
Block a user