[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-android] 03/03: [wallet] User friendlier p2p insufficient b
From: |
gnunet |
Subject: |
[taler-taler-android] 03/03: [wallet] User friendlier p2p insufficient balance error |
Date: |
Mon, 25 Mar 2024 18:09:06 +0100 |
This is an automated email from the git hooks/post-receive script.
torsten-grote pushed a commit to branch master
in repository taler-android.
commit 39b6926dd32b0731d87ea8daa94c1d4c29d3d193
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Fri Mar 22 12:31:08 2024 -0600
[wallet] User friendlier p2p insufficient balance error
bug 0008549
---
.../src/main/java/net/taler/wallet/peer/IncomingComposable.kt | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
b/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
index 0c118e6..1ce0175 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
@@ -48,6 +48,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import net.taler.common.Amount
import net.taler.wallet.R
+import
net.taler.wallet.backend.TalerErrorCode.WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE
+import
net.taler.wallet.backend.TalerErrorCode.WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE
import net.taler.wallet.backend.TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED
import net.taler.wallet.backend.TalerErrorInfo
@@ -187,11 +189,17 @@ fun ColumnScope.PeerPullTermsComposable(
@Composable
fun ColumnScope.PeerPullErrorComposable(s: IncomingError) {
+ val message = when (s.info.code) {
+ WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE ->
stringResource(R.string.payment_balance_insufficient)
+ WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE ->
stringResource(R.string.payment_balance_insufficient)
+ else -> s.info.userFacingMsg
+ }
+
Text(
modifier = Modifier
.align(CenterHorizontally)
.padding(horizontal = 32.dp),
- text = s.info.userFacingMsg,
+ text = message,
style = MaterialTheme.typography.headlineSmall,
color = MaterialTheme.colorScheme.error,
)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.