FIX: Show 'New' filter when 'none' subcategory set (#11474)

When set to 'none' it did not count topics from any category, but it
should count from the current one.

Follow up to df26d2e72a.
This commit is contained in:
Bianca Nenciu 2020-12-11 18:24:32 +02:00 committed by GitHub
parent 3b81c2d470
commit c4319b7b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -468,7 +468,7 @@ const TopicTrackingState = EmberObject.extend({
countCategoryByState(type, categoryId, tagId, noSubcategories) {
const subcategoryIds = noSubcategories
? new Set()
? new Set([categoryId])
: this.getSubCategoryIds(categoryId);
const mutedCategoryIds =
this.currentUser && this.currentUser.muted_category_ids;

View File

@ -290,6 +290,7 @@ module("Unit | Model | topic-tracking-state", function (hooks) {
};
assert.equal(state.countNew(1), 1);
assert.equal(state.countNew(1, undefined, true), 0);
assert.equal(state.countNew(1, "missing-tag"), 0);
assert.equal(state.countNew(2), 1);
assert.equal(state.countNew(3), 0);