Consider the empty push rule actions array equiv to deprecated dont_notify (#11155)
* Consider the empty push rule actions array equiv to deprecated dont_notify * Switch primary tests to empty actions, add test for dont_notify * strict types
This commit is contained in:
parent
6836a5fa7b
commit
209f5bdf33
3 changed files with 12 additions and 3 deletions
|
@ -219,7 +219,10 @@ function isRuleRoomMuteRuleForRoomId(roomId: string, rule: IPushRule): boolean {
|
|||
}
|
||||
|
||||
function isMuteRule(rule: IPushRule): boolean {
|
||||
return rule.actions.length === 1 && rule.actions[0] === PushRuleActionName.DontNotify;
|
||||
// DontNotify is equivalent to the empty actions array
|
||||
return (
|
||||
rule.actions.length === 0 || (rule.actions.length === 1 && rule.actions[0] === PushRuleActionName.DontNotify)
|
||||
);
|
||||
}
|
||||
|
||||
export function determineUnreadState(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue