fix PR comment

This commit is contained in:
Claire G 2022-03-16 11:52:33 +01:00
parent c7ac7c4b18
commit d53de395b8

View File

@ -40,14 +40,17 @@ data class RoomNotificationSettingsViewState(
*/
val RoomNotificationSettingsViewState.notificationStateMapped: Async<RoomNotificationState>
get() {
if ((roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY)) {
return when {
/**
* if in an encrypted room, mentions notifications are not supported so show "None" as selected.
* Also in the new settings there is no notion of notifications without sound so it maps to noisy also
*/
return Success(RoomNotificationState.MUTE)
(roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY)
-> Success(RoomNotificationState.MUTE)
(roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.ALL_MESSAGES)
-> Success(RoomNotificationState.ALL_MESSAGES_NOISY)
else -> notificationState
}
return notificationState
}
/**