commit 842b4208444826e73764faaa0b64829c305420c8
parent 143ff853f67a89b8e4415950f26c432682b777c2
Author: Iván Ávalos <avalos@disroot.org>
Date: Fri, 5 Dec 2025 14:14:23 +0100
[wallet] p2p: ToS check before user input
Diffstat:
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullComposable.kt b/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullComposable.kt
@@ -94,13 +94,13 @@ fun OutgoingPullComposable(
val tosReview = checkResult != null && checkResult?.tosStatus != ExchangeTosStatus.Accepted
amount.amount.useDebounce {
- if (amount.debounce && amount.userInput) {
+ if (amount.debounce) {
checkResult = checkPeerPullCredit(amount, false)
}
}
LaunchedEffect(amount) {
- if (!amount.debounce && amount.userInput) {
+ if (!amount.debounce) {
checkResult = checkPeerPullCredit(amount, true)
}
}
@@ -140,17 +140,11 @@ fun OutgoingPullComposable(
showAmount = !tosReview && state !is OutgoingError,
showShortcuts = true,
onAmountChanged = {
- amount = it.copy(
- debounce = amount.scope == it.scope,
- userInput = true,
- )
+ amount = it.copy(debounce = amount.scope == it.scope)
shortcutSelected = false
},
onShortcutSelected = {
- amount = it.copy(
- debounce = true,
- userInput = true,
- )
+ amount = it.copy(debounce = true)
shortcutSelected = true
},
isError = amount.amount.isZero(),
diff --git a/wallet/src/main/java/net/taler/wallet/peer/OutgoingPushComposable.kt b/wallet/src/main/java/net/taler/wallet/peer/OutgoingPushComposable.kt
@@ -118,9 +118,7 @@ fun OutgoingPushIntroComposable(
var hours by rememberSaveable { mutableLongStateOf(DEFAULT_EXPIRY.hours) }
amount.useDebounce {
- if (amount.userInput) {
- feeResult = getFees(it) ?: None()
- }
+ feeResult = getFees(it) ?: None()
}
val amountFocusRequester = remember { FocusRequester() }
@@ -174,11 +172,11 @@ fun OutgoingPushIntroComposable(
showAmount = state !is OutgoingError,
showShortcuts = true,
onAmountChanged = {
- amount = it.copy(userInput = true)
+ amount = it
shortcutSelected = false
},
onShortcutSelected = {
- amount = it.copy(userInput = true)
+ amount = it
shortcutSelected = true
},
label = { Text(stringResource(R.string.amount_send)) },