mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:39:28 +08:00
FIX: when category or tag is muted, update user (#9456)
Currently, when category or tag is muted, only after hard refresh, these new muted categories are really muted. Without a hard refresh, you will still receive "new topic" messages. Therefore, when tag or category is muted, we should update the user object right away.
This commit is contained in:

committed by
GitHub

parent
74e4102093
commit
e9f7262813
@ -104,3 +104,10 @@ QUnit.test("resolvedTimezone", assert => {
|
||||
);
|
||||
stub.restore();
|
||||
});
|
||||
|
||||
QUnit.test("muted ids", assert => {
|
||||
let user = User.create({ username: "chuck", muted_category_ids: [] });
|
||||
|
||||
assert.deepEqual(user.calculateMutedIds(0, 1, "muted_category_ids"), [1]);
|
||||
assert.deepEqual(user.calculateMutedIds(1, 1, "muted_category_ids"), []);
|
||||
});
|
||||
|
Reference in New Issue
Block a user