commit 950535bdc6e62b2a7e816bc89e7c5bb84c0899bf
parent c00d8abc28ac8e5cf01be7589d156e5718239bd8
Author: Iván Ávalos <avalos@disroot.org>
Date: Wed, 30 Apr 2025 22:49:34 +0200
[wallet] exchange error no longer prevents withdraw currency selection
bug 0009833
Diffstat:
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt
@@ -58,8 +58,8 @@ import net.taler.wallet.compose.collectAsStateLifecycleAware
import net.taler.wallet.exchanges.ExchangeItem
import net.taler.wallet.exchanges.ExchangeTosStatus
import net.taler.wallet.exchanges.SelectExchangeDialogFragment
-import net.taler.wallet.showError
import net.taler.wallet.withdraw.WithdrawStatus.Status.AlreadyConfirmed
+import net.taler.wallet.withdraw.WithdrawStatus.Status.Error
import net.taler.wallet.withdraw.WithdrawStatus.Status.InfoReceived
import net.taler.wallet.withdraw.WithdrawStatus.Status.Loading
import net.taler.wallet.withdraw.WithdrawStatus.Status.ManualTransferRequired
@@ -138,11 +138,6 @@ class PromptWithdrawFragment: Fragment() {
TalerSurface {
status.let { s ->
- if (s.error != null) {
- WithdrawalError(error = s.error)
- return@let
- }
-
if (defaultCurrency == null) {
LoadingScreen()
return@let
@@ -151,7 +146,7 @@ class PromptWithdrawFragment: Fragment() {
when (s.status) {
Loading, AlreadyConfirmed -> LoadingScreen()
- None, InfoReceived, TosReviewRequired, Updating -> {
+ None, Error, InfoReceived, TosReviewRequired, Updating -> {
// TODO: use scopeInfo instead of currency!
WithdrawalShowInfo(
status = s,
@@ -194,10 +189,6 @@ class PromptWithdrawFragment: Fragment() {
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
withdrawManager.withdrawStatus.collect { status ->
- if (status.error != null) {
- showError(status.error)
- }
-
if (status.exchangeBaseUrl == null
&& selectExchangeDialog.dialog?.isShowing != true) {
selectExchange()
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt
@@ -59,6 +59,7 @@ import net.taler.wallet.transactions.AmountType
import net.taler.wallet.transactions.TransactionAmountComposable
import net.taler.wallet.transactions.TransactionInfoComposable
import net.taler.wallet.useDebounce
+import net.taler.wallet.withdraw.WithdrawStatus.Status.Error
import net.taler.wallet.withdraw.WithdrawStatus.Status.TosReviewRequired
import net.taler.wallet.withdraw.WithdrawStatus.Status.Updating
@@ -164,6 +165,11 @@ fun WithdrawalShowInfo(
)
}
+ if (status.status == Error && status.error != null) {
+ WithdrawalError(status.error)
+ return
+ }
+
if (!wireFee.isZero()) {
TransactionAmountComposable(
label = stringResource(R.string.amount_fee),