mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 08:32:53 +02:00
Change in behaviour: mute should actually mean mute on update now.
This commit is contained in:
@@ -61,8 +61,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel
|
||||
self.state.notificationState = state
|
||||
case .save:
|
||||
self.state.saving = true
|
||||
let updateState = Self.mapNotificationStateOnUpdate(encrypted: self.state.roomEncrypted, state: state.notificationState)
|
||||
roomNotificationRepository.update(state: updateState) { [weak self] in
|
||||
roomNotificationRepository.update(state: state.notificationState) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.state.saving = false
|
||||
self.coordinatorDelegate?.roomNotificationSettingsViewModelDidComplete(self)
|
||||
@@ -83,15 +82,6 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private static func mapNotificationStateOnUpdate(encrypted: Bool, state: RoomNotificationState) -> RoomNotificationState {
|
||||
if encrypted, case .mute = state {
|
||||
// Notifications not supported on encrypted rooms, map mute to mentions only on update
|
||||
return .mentionsOnly
|
||||
} else {
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
private func update(viewState: RoomNotificationSettingsViewStateType) {
|
||||
self.viewDelegate?.roomNotificationSettingsViewModel(self, didUpdateViewState: viewState)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user