mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Improve setDefaultRoomNotificationMode err handling (#1852)
This commit is contained in:
@@ -73,7 +73,15 @@ final class NotificationSettingsProxy: NotificationSettingsProxyProtocol {
|
|||||||
let backgroundTask = await backgroundTaskService?.startBackgroundTask(withName: "setDefaultRoomNotificationMode")
|
let backgroundTask = await backgroundTaskService?.startBackgroundTask(withName: "setDefaultRoomNotificationMode")
|
||||||
defer { backgroundTask?.stop() }
|
defer { backgroundTask?.stop() }
|
||||||
|
|
||||||
try await notificationSettings.setDefaultRoomNotificationMode(isEncrypted: isEncrypted, isOneToOne: isOneToOne, mode: mode.roomNotificationMode)
|
do {
|
||||||
|
try await notificationSettings.setDefaultRoomNotificationMode(isEncrypted: isEncrypted, isOneToOne: isOneToOne, mode: mode.roomNotificationMode)
|
||||||
|
} catch NotificationSettingsError.RuleNotFound(let ruleId) {
|
||||||
|
// `setDefaultRoomNotificationMode` updates multiple rules including unstable rules (e.g. the polls push rules defined in the MSC3930)
|
||||||
|
// since production home servers may not have these rules yet, we drop the RuleNotFound error
|
||||||
|
MXLog.warning("Unable to find the rule: \(ruleId)")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
await updatedSettings()
|
await updatedSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user