commit 7c4acb137b850adb1dd01428926cdbd907778dc1
parent 44f5925e8682c1fd2212989f8d64c4c15d77a905
Author: Iván Ávalos <avalos@disroot.org>
Date: Wed, 10 Dec 2025 07:57:05 +0100
[wallet] fix: use proper amount shortcuts from currency spec
Diffstat:
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/compose/AmountInputFIeld.kt b/wallet/src/main/java/net/taler/wallet/compose/AmountInputFIeld.kt
@@ -127,16 +127,10 @@ fun AmountCurrencyField(
}
}
- if (showShortcuts) {
- val currency = amount.currency
+ val commonAmounts = amount.spec?.commonAmounts
+ if (showShortcuts && commonAmounts != null) {
AmountInputShortcuts(
- // TODO: currency-appropriate presets
- amounts = listOf(
- Amount.fromString(currency, "50").withSpec(amount.spec),
- Amount.fromString(currency, "25").withSpec(amount.spec),
- Amount.fromString(currency, "10").withSpec(amount.spec),
- Amount.fromString(currency, "5").withSpec(amount.spec),
- ),
+ amounts = commonAmounts,
onSelected = { shortcut ->
onShortcutSelected?.let { it(shortcut) }
},