Improve sats numeric entry for zaps

Changelog-Changed: Add number formatting for sats entry and use selected zaps amount from picker as placeholder
Changelog-Fixed: Do not allow non-numeric characters for sats amount and fix numeric entry for other number systems for all locales
This commit is contained in:
2023-04-16 18:06:34 +02:00
committed by William Casarin
parent ddd027141a
commit bff3c0dd52
6 changed files with 26 additions and 16 deletions

View File

@@ -26,11 +26,13 @@ func set_default_zap_amount(pubkey: String, amount: Int) {
UserDefaults.standard.setValue(amount, forKey: key)
}
func get_default_zap_amount(pubkey: String) -> Int? {
let fallback_zap_amount = 1000
func get_default_zap_amount(pubkey: String) -> Int {
let key = default_zap_setting_key(pubkey: pubkey)
let amt = UserDefaults.standard.integer(forKey: key)
if amt == 0 {
return nil
return fallback_zap_amount
}
return amt
}