Updated on 2026-08-14
This commit is contained in:
parent
046b64701a
commit
ed3ee24cec
1 changed files with 7 additions and 4 deletions
|
|
@ -618,7 +618,9 @@ internal class SendViewModel @Inject constructor(
|
|||
network = cryptoCurrency.network,
|
||||
address = value,
|
||||
).getOrElse { false }
|
||||
onEnteredValidAddress(isValidAddress)
|
||||
val isAddressInWallet = cryptoCurrencyStatus.value.networkAddress?.availableAddresses
|
||||
?.any { it.value == value } ?: true
|
||||
onEnteredValidAddress(isValidAddress, isAddressInWallet)
|
||||
return isValidAddress
|
||||
}
|
||||
|
||||
|
|
@ -632,12 +634,13 @@ internal class SendViewModel @Inject constructor(
|
|||
} ?: false
|
||||
}
|
||||
|
||||
private fun onEnteredValidAddress(isValidAddress: Boolean) {
|
||||
private fun onEnteredValidAddress(isValidAddress: Boolean, isAddressInWallet: Boolean) {
|
||||
val recipientState = uiState.recipientState ?: return
|
||||
val isVisible = isAddressInWallet || !isValidAddress
|
||||
uiState = uiState.copy(
|
||||
recipientState = recipientState.copy(
|
||||
recent = recipientState.recent.map { it.copy(isVisible = !isValidAddress) }.toPersistentList(),
|
||||
wallets = recipientState.wallets.map { it.copy(isVisible = !isValidAddress) }.toPersistentList(),
|
||||
recent = recipientState.recent.map { it.copy(isVisible = isVisible) }.toPersistentList(),
|
||||
wallets = recipientState.wallets.map { it.copy(isVisible = isVisible) }.toPersistentList(),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue