taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit 7392cd72ddd3406369b13bd8a7f57fb18822eaa2
parent cdf0315436a378b1a63142ecb9ef3c15d5f4db30
Author: Iván Ávalos <avalos@disroot.org>
Date:   Tue,  5 Sep 2023 09:55:17 -0600

[wallet] show p2p QR codes until tx ready

bug 0007933

Diffstat:
Mwallet/src/main/java/net/taler/wallet/peer/TransactionPeerPullCredit.kt | 3++-
Mwallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt | 23+++++++++++++----------
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 @@ -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 @@ -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), + ) + } } }