Browse Source

AsyncActionView: provide the value to the confirmationDialog lambda.

pull/3667/head
Benoit Marty 4 days ago
parent
commit
ecd7bb0458
  1. 4
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/async/AsyncActionView.kt

4
libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/async/AsyncActionView.kt

@ -34,7 +34,7 @@ fun <T> AsyncActionView( @@ -34,7 +34,7 @@ fun <T> AsyncActionView(
async: AsyncAction<T>,
onSuccess: (T) -> Unit,
onErrorDismiss: () -> Unit,
confirmationDialog: @Composable () -> Unit = { },
confirmationDialog: @Composable (AsyncAction.Confirming) -> Unit = { },
progressDialog: @Composable () -> Unit = { AsyncActionViewDefaults.ProgressDialog() },
errorTitle: @Composable (Throwable) -> String = { ErrorDialogDefaults.title },
errorMessage: @Composable (Throwable) -> String = { it.message ?: it.toString() },
@ -42,7 +42,7 @@ fun <T> AsyncActionView( @@ -42,7 +42,7 @@ fun <T> AsyncActionView(
) {
when (async) {
AsyncAction.Uninitialized -> Unit
is AsyncAction.Confirming -> confirmationDialog()
is AsyncAction.Confirming -> confirmationDialog(async)
is AsyncAction.Loading -> progressDialog()
is AsyncAction.Failure -> {
if (onRetry == null) {

Loading…
Cancel
Save