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 = {
wantsToZap = true
},
onError = {
scope.launch {
zappingProgress = 0f
showErrorMessageDialog = it
}
}
)
},
@@ -1020,7 +1026,8 @@ private fun zapClick(
scope: CoroutineScope,
context: Context,
onZappingProgress: (Float) -> Unit,
onMultipleChoices: () -> Unit
onMultipleChoices: () -> Unit,
onError: (String) -> Unit
) {
if (accountViewModel.account.zapAmountChoices.isEmpty()) {
scope.launch {
@@ -1049,14 +1056,7 @@ private fun zapClick(
null,
"",
context,
onError = {
scope.launch {
onZappingProgress(0f)
Toast
.makeText(context, it, Toast.LENGTH_SHORT)
.show()
}
},
onError = onError,
onProgress = {
scope.launch(Dispatchers.Main) {
onZappingProgress(it)