You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Only try to delete room rule if it exists
This commit is contained in:
@@ -100,7 +100,10 @@ function setRoomNotifsStateUnmuted(roomId, newState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newState == 'all_messages') {
|
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') {
|
} else if (newState == 'mentions_only') {
|
||||||
promises.push(cli.addPushRule('global', 'room', roomId, {
|
promises.push(cli.addPushRule('global', 'room', roomId, {
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
Reference in New Issue
Block a user