mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Merge pull request #421 from matrix-org/dbkr/fix_mute_to_all_messages
Only try to delete room rule if it exists
This commit is contained in:
commit
d23ed642a0
1 changed files with 4 additions and 1 deletions
|
@ -100,7 +100,10 @@ function setRoomNotifsStateUnmuted(roomId, newState) {
|
|||
}
|
||||
|
||||
if (newState == 'all_messages') {
|
||||
promises.push(cli.deletePushRule('global', 'room', roomId));
|
||||
const roomRule = cli.getRoomPushRule('global', roomId);
|
||||
if (roomRule) {
|
||||
promises.push(cli.deletePushRule('global', 'room', roomRule.rule_id));
|
||||
}
|
||||
} else if (newState == 'mentions_only') {
|
||||
promises.push(cli.addPushRule('global', 'room', roomId, {
|
||||
actions: [
|
||||
|
|
Loading…
Reference in a new issue