Signed-off-by: Ajay Bura <ajbura@gmail.com>
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) {
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;