Updated on 2026-08-14
This commit is contained in:
parent
54d476cadd
commit
d258cb2f5c
1 changed files with 5 additions and 4 deletions
|
|
@ -107,10 +107,7 @@ internal class DefaultSwapComponent @AssistedInject constructor(
|
|||
val fromCryptoCurrency by remember { derivedStateOf { dataState.fromCryptoCurrency } }
|
||||
val feePaidCryptoCurrency by remember { derivedStateOf { dataState.feePaidCryptoCurrency } }
|
||||
val shouldHideBlock by remember {
|
||||
derivedStateOf {
|
||||
dataState.amount.isNullOrBlank() || BigDecimal(dataState.amount).isZero() ||
|
||||
model.uiState.isInsufficientFunds
|
||||
}
|
||||
derivedStateOf { toBigDecimalOrZero(dataState.amount).isZero() || model.uiState.isInsufficientFunds }
|
||||
}
|
||||
|
||||
LaunchedEffect(fromCryptoCurrency, feePaidCryptoCurrency, shouldHideBlock) {
|
||||
|
|
@ -208,6 +205,10 @@ internal class DefaultSwapComponent @AssistedInject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
private fun toBigDecimalOrZero(bigDecimalString: String?): BigDecimal {
|
||||
return bigDecimalString?.replace(",", ".")?.toBigDecimalOrNull() ?: BigDecimal.ZERO
|
||||
}
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory : SwapComponent.Factory {
|
||||
override fun create(context: AppComponentContext, params: SwapComponent.Params): DefaultSwapComponent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue