Updated on 2026-08-14
This commit is contained in:
parent
eb073895c1
commit
8f559d4664
3 changed files with 5 additions and 5 deletions
|
|
@ -254,7 +254,6 @@ data class WalletData(
|
|||
val mainButton: WalletMainButton = WalletMainButton.SendButton(false),
|
||||
val currency: Currency,
|
||||
val warningRent: WalletRent? = null,
|
||||
val blockchainAmount: BigDecimal? = BigDecimal.ZERO
|
||||
) {
|
||||
fun shouldShowMultipleAddress(): Boolean {
|
||||
val listOfAddresses = walletAddresses?.list ?: return false
|
||||
|
|
@ -268,7 +267,7 @@ data class WalletData(
|
|||
|
||||
fun shouldEnableTokenSendButton(): Boolean = !blockchainAmountIsEmpty() || !tokenAmountIsEmpty()
|
||||
|
||||
private fun blockchainAmountIsEmpty(): Boolean = blockchainAmount?.isZero() ?: false
|
||||
private fun blockchainAmountIsEmpty(): Boolean = currencyData.blockchainAmount?.isZero() ?: false
|
||||
private fun tokenAmountIsEmpty(): Boolean = currencyData.amount?.isZero() == true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class OnWalletLoadedReducer {
|
|||
currencyData = walletData.currencyData.copy(
|
||||
status = balanceStatus, currency = wallet.blockchain.fullName,
|
||||
currencySymbol = wallet.blockchain.currency,
|
||||
blockchainAmount = coinAmountValue,
|
||||
amount = coinAmountValue,
|
||||
amountFormatted = formattedAmount,
|
||||
fiatAmount = fiatAmount,
|
||||
|
|
@ -64,7 +65,6 @@ class OnWalletLoadedReducer {
|
|||
mainButton = WalletMainButton.SendButton(coinSendButton),
|
||||
currency = Currency.Blockchain(wallet.blockchain),
|
||||
tradeCryptoState = TradeCryptoState.from(exchangeManager, walletData),
|
||||
blockchainAmount = coinAmountValue
|
||||
)
|
||||
|
||||
val tokens = wallet.getTokens().mapNotNull { token ->
|
||||
|
|
@ -83,6 +83,7 @@ class OnWalletLoadedReducer {
|
|||
tokenWalletData?.copy(
|
||||
currencyData = tokenWalletData.currencyData.copy(
|
||||
status = tokenBalanceStatus,
|
||||
blockchainAmount = coinAmountValue,
|
||||
amount = tokenAmountValue,
|
||||
amountFormatted = tokenAmountValue?.toFormattedCurrencyString(token.decimals, token.symbol),
|
||||
fiatAmount = tokenFiatAmount,
|
||||
|
|
@ -91,7 +92,6 @@ class OnWalletLoadedReducer {
|
|||
pendingTransactions = tokenPendingTransactions.removeUnknownTransactions(),
|
||||
mainButton = WalletMainButton.SendButton(tokenSendButton),
|
||||
tradeCryptoState = TradeCryptoState.from(exchangeManager, tokenWalletData),
|
||||
blockchainAmount = coinAmountValue
|
||||
)
|
||||
}
|
||||
val newWallets = (tokens + newWalletData).mapNotNull { it }
|
||||
|
|
@ -151,6 +151,7 @@ class OnWalletLoadedReducer {
|
|||
balanceStatus, wallet.blockchain.fullName,
|
||||
currencySymbol = wallet.blockchain.currency,
|
||||
token = tokenData,
|
||||
blockchainAmount = amount,
|
||||
amount = amount,
|
||||
amountFormatted = formattedAmount,
|
||||
fiatAmountFormatted = fiatAmount,
|
||||
|
|
@ -159,7 +160,6 @@ class OnWalletLoadedReducer {
|
|||
pendingTransactions = pendingTransactions.removeUnknownTransactions(),
|
||||
mainButton = WalletMainButton.SendButton(sendButtonEnabled),
|
||||
tradeCryptoState = TradeCryptoState.from(exchangeManager, walletState.primaryWallet),
|
||||
blockchainAmount = amount
|
||||
)
|
||||
val wallets = walletData?.let { listOf(walletData) } ?: emptyList()
|
||||
return walletState.copy(
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ data class BalanceWidgetData(
|
|||
val status: BalanceStatus? = null,
|
||||
val currency: String? = null,
|
||||
val currencySymbol: String? = null,
|
||||
val blockchainAmount: BigDecimal? = BigDecimal.ZERO,
|
||||
val amount: BigDecimal? = null,
|
||||
val amountFormatted: String? = null,
|
||||
val fiatAmountFormatted: String? = null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue