Updated on 2026-08-14
This commit is contained in:
parent
bca3e4e18e
commit
8c792a2ce8
1 changed files with 13 additions and 1 deletions
|
|
@ -180,7 +180,7 @@ class WalletMiddleware {
|
|||
}
|
||||
|
||||
if (walletState.isMultiwalletAllowed) {
|
||||
val amountToSend = sendableAmounts.find { it.currencySymbol == currency.currencySymbol }
|
||||
val amountToSend = findAmountToSend(currency = currency, amounts = sendableAmounts)
|
||||
if (amountToSend == null) {
|
||||
val error = TapError.UnsupportedState("WalletAction.Send: Amount to send is null")
|
||||
FirebaseCrashlytics.getInstance().recordException(IllegalStateException(error.stateError))
|
||||
|
|
@ -277,6 +277,18 @@ class WalletMiddleware {
|
|||
}
|
||||
}
|
||||
|
||||
private fun findAmountToSend(currency: Currency, amounts: List<Amount>): Amount? {
|
||||
return amounts.find { amount ->
|
||||
val amountType = amount.type
|
||||
if (amountType is AmountType.Token && currency is Currency.Token) {
|
||||
val token = amountType.token
|
||||
token.symbol == currency.currencySymbol && token.contractAddress == currency.token.contractAddress
|
||||
} else {
|
||||
amount.currencySymbol == currency.currencySymbol
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun makeInitSendStateActionByAmount(
|
||||
amount: Amount,
|
||||
walletStore: WalletStoreModel,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue