diff --git a/src/app/molecules/room-notification/RoomNotification.jsx b/src/app/molecules/room-notification/RoomNotification.jsx index 26d123b..0a3619f 100644 --- a/src/app/molecules/room-notification/RoomNotification.jsx +++ b/src/app/molecules/room-notification/RoomNotification.jsx @@ -35,7 +35,12 @@ const items = [{ function setRoomNotifType(roomId, newType) { const mx = initMatrix.matrixClient; const { notifications } = initMatrix; - const roomPushRule = mx.getRoomPushRule('global', roomId); + let roomPushRule; + try { + roomPushRule = mx.getRoomPushRule('global', roomId); + } catch { + roomPushRule = undefined; + } const promises = []; if (newType === cons.notifs.MUTE) { diff --git a/src/client/state/Notifications.js b/src/client/state/Notifications.js index 9633852..512b3e7 100644 --- a/src/client/state/Notifications.js +++ b/src/client/state/Notifications.js @@ -83,7 +83,12 @@ class Notifications extends EventEmitter { getNotiType(roomId) { const mx = this.matrixClient; - const pushRule = mx.getRoomPushRule('global', roomId); + let pushRule; + try { + pushRule = mx.getRoomPushRule('global', roomId); + } catch { + pushRule = undefined; + } if (pushRule === undefined) { const overrideRules = mx.getAccountData('m.push_rules')?.getContent()?.global?.override;