AsyncActionView: provide the value to the confirmationDialog lambda.

This commit is contained in:
Benoit Marty
2024-10-14 11:02:47 +02:00
parent 97fb7bc2fa
commit f2df8a2064

View File

@@ -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(
) {
when (async) {
AsyncAction.Uninitialized -> Unit
is AsyncAction.Confirming -> confirmationDialog()
is AsyncAction.Confirming -> confirmationDialog(async)
is AsyncAction.Loading -> progressDialog()
is AsyncAction.Failure -> {
if (onRetry == null) {