Migrates from Toast Message to a Dialog when Zap fails in the reaction row.

This commit is contained in:
Vitor Pamplona
2023-08-29 16:43:45 -04:00
parent da02891c6a
commit 6099948605
@@ -932,6 +932,12 @@ fun ZapReaction(
}, },
onMultipleChoices = { onMultipleChoices = {
wantsToZap = true wantsToZap = true
},
onError = {
scope.launch {
zappingProgress = 0f
showErrorMessageDialog = it
}
} }
) )
}, },
@@ -1020,7 +1026,8 @@ private fun zapClick(
scope: CoroutineScope, scope: CoroutineScope,
context: Context, context: Context,
onZappingProgress: (Float) -> Unit, onZappingProgress: (Float) -> Unit,
onMultipleChoices: () -> Unit onMultipleChoices: () -> Unit,
onError: (String) -> Unit
) { ) {
if (accountViewModel.account.zapAmountChoices.isEmpty()) { if (accountViewModel.account.zapAmountChoices.isEmpty()) {
scope.launch { scope.launch {
@@ -1049,14 +1056,7 @@ private fun zapClick(
null, null,
"", "",
context, context,
onError = { onError = onError,
scope.launch {
onZappingProgress(0f)
Toast
.makeText(context, it, Toast.LENGTH_SHORT)
.show()
}
},
onProgress = { onProgress = {
scope.launch(Dispatchers.Main) { scope.launch(Dispatchers.Main) {
onZappingProgress(it) onZappingProgress(it)