Remove default value for lambda.

We enforce a value to be provided and it's better for code coverage.
This commit is contained in:
Benoit Marty 2023-11-22 17:20:00 +01:00
parent 9520e35374
commit ae0c3edd24
49 changed files with 424 additions and 225 deletions

View file

@ -38,9 +38,9 @@ import io.element.android.libraries.theme.ElementTheme
@Composable
fun DefaultNotificationSettingOption(
mode: RoomNotificationMode,
onOptionSelected: (RoomNotificationMode) -> Unit,
modifier: Modifier = Modifier,
isSelected: Boolean = false,
onOptionSelected: (RoomNotificationMode) -> Unit = {},
) {
val subtitle = when(mode) {
RoomNotificationMode.ALL_MESSAGES -> stringResource(id = R.string.screen_notification_settings_edit_mode_all_messages)
@ -86,10 +86,12 @@ internal fun DefaultNotificationSettingOptionPreview() = ElementPreview {
DefaultNotificationSettingOption(
mode = RoomNotificationMode.ALL_MESSAGES,
isSelected = true,
onOptionSelected = {},
)
DefaultNotificationSettingOption(
mode = RoomNotificationMode.MENTIONS_AND_KEYWORDS_ONLY,
isSelected = false,
onOptionSelected = {},
)
}
}