Remove default value for lambda.

We enforce a value to be provided and it's better for code code coverage.
This commit is contained in:
Benoit Marty 2023-11-22 14:55:14 +01:00
parent 60f58f9915
commit 9520e35374
2 changed files with 12 additions and 5 deletions

View file

@ -51,9 +51,9 @@ import io.element.android.libraries.ui.strings.CommonStrings
@Composable
fun RoomNotificationSettingsView(
state: RoomNotificationSettingsState,
onShowGlobalNotifications: () -> Unit,
onBackPressed: () -> Unit,
modifier: Modifier = Modifier,
onShowGlobalNotifications: () -> Unit = {},
onBackPressed: () -> Unit = {},
) {
if (state.showUserDefinedSettingStyle) {
UserDefinedRoomNotificationSettingsView(
@ -193,5 +193,9 @@ private fun RoomNotificationSettingsTopBar(
internal fun RoomNotificationSettingsPreview(
@PreviewParameter(RoomNotificationSettingsStateProvider::class) state: RoomNotificationSettingsState
) = ElementPreview {
RoomNotificationSettingsView(state)
RoomNotificationSettingsView(
state = state,
onShowGlobalNotifications = {},
onBackPressed = {},
)
}

View file

@ -42,8 +42,8 @@ import io.element.android.libraries.designsystem.theme.components.TopAppBar
@Composable
fun UserDefinedRoomNotificationSettingsView(
state: RoomNotificationSettingsState,
onBackPressed: () -> Unit,
modifier: Modifier = Modifier,
onBackPressed: () -> Unit = {},
) {
Scaffold(
modifier = modifier,
@ -120,5 +120,8 @@ private fun UserDefinedRoomNotificationSettingsTopBar(
internal fun UserDefinedRoomNotificationSettingsPreview(
@PreviewParameter(UserDefinedRoomNotificationSettingsStateProvider::class) state: RoomNotificationSettingsState
) = ElementPreview {
UserDefinedRoomNotificationSettingsView(state)
UserDefinedRoomNotificationSettingsView(
state = state,
onBackPressed = {},
)
}