Skip to content

Commit

Permalink
[Notification mode] Wrong mode is displayed when the mention only is …
Browse files Browse the repository at this point in the history
…selected on the web client
  • Loading branch information
Claire1817 authored Mar 16, 2022
1 parent 99b43fd commit d1bca78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/5547.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Notification mode] Wrong mode is displayed when the mention only is selected on the web client
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ data class RoomNotificationSettingsViewState(
*/
val RoomNotificationSettingsViewState.notificationStateMapped: Async<RoomNotificationState>
get() {
if ((roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY) ||
notificationState() == RoomNotificationState.ALL_MESSAGES) {
/** if in an encrypted room, mentions notifications are not supported so show "All Messages" as selected.
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.ALL_MESSAGES_NOISY)
(roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY)
-> Success(RoomNotificationState.MUTE)
notificationState() == RoomNotificationState.ALL_MESSAGES -> Success(RoomNotificationState.ALL_MESSAGES_NOISY)
else -> notificationState
}
return notificationState
}

/**
Expand Down

0 comments on commit d1bca78

Please sign in to comment.