mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
AsyncActionView: provide the value to the confirmationDialog lambda.
This commit is contained in:
+2
-2
@@ -34,7 +34,7 @@ fun <T> AsyncActionView(
|
|||||||
async: AsyncAction<T>,
|
async: AsyncAction<T>,
|
||||||
onSuccess: (T) -> Unit,
|
onSuccess: (T) -> Unit,
|
||||||
onErrorDismiss: () -> Unit,
|
onErrorDismiss: () -> Unit,
|
||||||
confirmationDialog: @Composable () -> Unit = { },
|
confirmationDialog: @Composable (AsyncAction.Confirming) -> Unit = { },
|
||||||
progressDialog: @Composable () -> Unit = { AsyncActionViewDefaults.ProgressDialog() },
|
progressDialog: @Composable () -> Unit = { AsyncActionViewDefaults.ProgressDialog() },
|
||||||
errorTitle: @Composable (Throwable) -> String = { ErrorDialogDefaults.title },
|
errorTitle: @Composable (Throwable) -> String = { ErrorDialogDefaults.title },
|
||||||
errorMessage: @Composable (Throwable) -> String = { it.message ?: it.toString() },
|
errorMessage: @Composable (Throwable) -> String = { it.message ?: it.toString() },
|
||||||
@@ -42,7 +42,7 @@ fun <T> AsyncActionView(
|
|||||||
) {
|
) {
|
||||||
when (async) {
|
when (async) {
|
||||||
AsyncAction.Uninitialized -> Unit
|
AsyncAction.Uninitialized -> Unit
|
||||||
is AsyncAction.Confirming -> confirmationDialog()
|
is AsyncAction.Confirming -> confirmationDialog(async)
|
||||||
is AsyncAction.Loading -> progressDialog()
|
is AsyncAction.Loading -> progressDialog()
|
||||||
is AsyncAction.Failure -> {
|
is AsyncAction.Failure -> {
|
||||||
if (onRetry == null) {
|
if (onRetry == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user