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 542de5a487
commit 4ae0790cc1
49 changed files with 424 additions and 225 deletions

View file

@ -134,8 +134,8 @@ class RootFlowNode @AssistedInject constructor(
private suspend fun restoreSessionIfNeeded(
sessionId: SessionId,
onFailure: () -> Unit = {},
onSuccess: (SessionId) -> Unit = {},
onFailure: () -> Unit,
onSuccess: (SessionId) -> Unit,
) {
matrixClientsHolder.getOrRestore(sessionId)
.onSuccess {
@ -149,8 +149,8 @@ class RootFlowNode @AssistedInject constructor(
}
private suspend fun tryToRestoreLatestSession(
onSuccess: (SessionId) -> Unit = {},
onFailure: () -> Unit = {}
onSuccess: (SessionId) -> Unit,
onFailure: () -> Unit
) {
val latestSessionId = authenticationService.getLatestSessionId()
if (latestSessionId == null) {

View file

@ -35,8 +35,8 @@ import io.element.android.services.apperror.impl.AppErrorView
@Composable
fun RootView(
state: RootState,
onOpenBugReport: () -> Unit,
modifier: Modifier = Modifier,
onOpenBugReport: () -> Unit = {},
children: @Composable BoxScope.() -> Unit,
) {
Box(
@ -69,7 +69,10 @@ fun RootView(
@PreviewsDayNight
@Composable
internal fun RootPreview(@PreviewParameter(RootStateProvider::class) rootState: RootState) = ElementPreview {
RootView(rootState) {
RootView(
state = rootState,
onOpenBugReport = {},
) {
Text("Children")
}
}