summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-09-05 09:55:17 -0600
committerTorsten Grote <t@grobox.de>2023-09-05 18:30:10 +0200
commit7392cd72ddd3406369b13bd8a7f57fb18822eaa2 (patch)
tree50de32a5551296001b15aee388456591351fc736
parentcdf0315436a378b1a63142ecb9ef3c15d5f4db30 (diff)
downloadtaler-android-7392cd72ddd3406369b13bd8a7f57fb18822eaa2.tar.gz
taler-android-7392cd72ddd3406369b13bd8a7f57fb18822eaa2.tar.bz2
taler-android-7392cd72ddd3406369b13bd8a7f57fb18822eaa2.zip
[wallet] show p2p QR codes until tx ready
bug 0007933
-rw-r--r--wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPullCredit.kt3
-rw-r--r--wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt23
2 files changed, 15 insertions, 11 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPullCredit.kt b/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPullCredit.kt
index fe847b3..b04a756 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPullCredit.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPullCredit.kt
@@ -40,6 +40,7 @@ import net.taler.wallet.transactions.TransactionAction.Suspend
import net.taler.wallet.transactions.TransactionAmountComposable
import net.taler.wallet.transactions.TransactionInfoComposable
import net.taler.wallet.transactions.TransactionMajorState.Pending
+import net.taler.wallet.transactions.TransactionMinorState.Ready
import net.taler.wallet.transactions.TransactionPeerComposable
import net.taler.wallet.transactions.TransactionPeerPullCredit
import net.taler.wallet.transactions.TransactionState
@@ -68,7 +69,7 @@ fun ColumnScope.TransactionPeerPullCreditComposable(t: TransactionPeerPullCredit
label = stringResource(id = R.string.send_peer_purpose),
info = t.info.summary ?: "",
)
- if (t.txState.major == Pending) {
+ if (t.txState == TransactionState(Pending, Ready)) {
QrCodeUriComposable(
talerUri = t.talerUri,
clipBoardLabel = "Invoice",
diff --git a/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt b/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt
index 796f7fc..2587ea9 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt
@@ -40,6 +40,7 @@ import net.taler.wallet.transactions.TransactionAction.Suspend
import net.taler.wallet.transactions.TransactionAmountComposable
import net.taler.wallet.transactions.TransactionInfoComposable
import net.taler.wallet.transactions.TransactionMajorState.Pending
+import net.taler.wallet.transactions.TransactionMinorState.Ready
import net.taler.wallet.transactions.TransactionPeerComposable
import net.taler.wallet.transactions.TransactionPeerPushDebit
import net.taler.wallet.transactions.TransactionState
@@ -68,16 +69,18 @@ fun ColumnScope.TransactionPeerPushDebitComposable(t: TransactionPeerPushDebit)
label = stringResource(id = R.string.send_peer_purpose),
info = t.info.summary ?: "",
)
- QrCodeUriComposable(
- talerUri = t.talerUri,
- clipBoardLabel = "Push payment",
- buttonText = stringResource(id = R.string.copy),
- ) {
- Text(
- modifier = Modifier.padding(horizontal = 16.dp),
- style = MaterialTheme.typography.bodyLarge,
- text = stringResource(id = R.string.receive_peer_invoice_uri),
- )
+ if (t.txState == TransactionState(Pending, Ready)) {
+ QrCodeUriComposable(
+ talerUri = t.talerUri,
+ clipBoardLabel = "Push payment",
+ buttonText = stringResource(id = R.string.copy),
+ ) {
+ Text(
+ modifier = Modifier.padding(horizontal = 16.dp),
+ style = MaterialTheme.typography.bodyLarge,
+ text = stringResource(id = R.string.receive_peer_invoice_uri),
+ )
+ }
}
}