mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
parent
3b81c2d470
commit
c4319b7b55
@ -468,7 +468,7 @@ const TopicTrackingState = EmberObject.extend({
|
|||||||
|
|
||||||
countCategoryByState(type, categoryId, tagId, noSubcategories) {
|
countCategoryByState(type, categoryId, tagId, noSubcategories) {
|
||||||
const subcategoryIds = noSubcategories
|
const subcategoryIds = noSubcategories
|
||||||
? new Set()
|
? new Set([categoryId])
|
||||||
: this.getSubCategoryIds(categoryId);
|
: this.getSubCategoryIds(categoryId);
|
||||||
const mutedCategoryIds =
|
const mutedCategoryIds =
|
||||||
this.currentUser && this.currentUser.muted_category_ids;
|
this.currentUser && this.currentUser.muted_category_ids;
|
||||||
|
@ -290,6 +290,7 @@ module("Unit | Model | topic-tracking-state", function (hooks) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert.equal(state.countNew(1), 1);
|
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(1, "missing-tag"), 0);
|
||||||
assert.equal(state.countNew(2), 1);
|
assert.equal(state.countNew(2), 1);
|
||||||
assert.equal(state.countNew(3), 0);
|
assert.equal(state.countNew(3), 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user