[#1138] Malformed pattern: Grouping separator

* [#1138] Malformed pattern: Grouping separator

- This handles possible malformed format pattern exceptions in Zashi, but the proper solution needs to be provided within the SDK. See  #1315.
- Closes #1138

* Changelog update
This commit is contained in:
Honza Rychnovský 2023-12-21 17:46:02 +01:00 committed by GitHub
parent c901a63d54
commit b42db7b035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -17,6 +17,11 @@ directly impact users rather than highlighting other key architectural updates.*
- Send form now supports software keyboard confirm actions
- And a few more miner UI improvements
### Fixed
- Resizing Send screen Form TextFields when focused
- Hidden Send screen Form TextFields behind the software keyboard when focused
- Monetary separators issues on the Send screen Form
## [0.2.0 (505)] - 2023-12-11
### Added

View File

@ -53,6 +53,7 @@ import cash.z.ecc.android.sdk.model.fromZecString
import cash.z.ecc.android.sdk.model.toZecString
import cash.z.ecc.sdk.fixture.MemoFixture
import cash.z.ecc.sdk.fixture.ZatoshiFixture
import co.electriccoin.zcash.spackle.Twig
import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.test.CommonTag
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
@ -398,9 +399,18 @@ private fun SendForm(
FormTextField(
value = amountZecString,
onValueChange = { newValue ->
if (!ZecStringExt.filterContinuous(context, monetarySeparators, newValue)) {
val validated =
runCatching {
ZecStringExt.filterContinuous(context, monetarySeparators, newValue)
}.onFailure {
Twig.error(it) { "Failed while filtering incoming characters in filterContinuous" }
return@FormTextField
}.getOrDefault(false)
if (!validated) {
return@FormTextField
}
amountZecString = newValue.filter { allowedCharacters.contains(it) }
},
keyboardOptions =