Updated on 2026-08-14
This commit is contained in:
parent
1d0d0da8bc
commit
8882b38a51
1 changed files with 6 additions and 4 deletions
|
|
@ -595,13 +595,15 @@ internal class AddCustomTokenViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun isTokenAlreadyAdded(): Boolean {
|
||||
val networkSelectorValue = uiState.form.networkSelectorField.selectedItem.blockchain
|
||||
val networkId = Blockchain.fromNetworkId(networkSelectorValue.toNetworkId())?.id
|
||||
val contractAddress = convertTokenAddress(
|
||||
blockchain = networkSelectorValue,
|
||||
address = uiState.form.contractAddressInputField.value,
|
||||
)
|
||||
return currentCryptoCurrencies
|
||||
.filterIsInstance<CryptoCurrency.Token>()
|
||||
.any { token ->
|
||||
val contractAddress = uiState.form.contractAddressInputField.value
|
||||
val networkSelectorValue = uiState.form.networkSelectorField.selectedItem.blockchain
|
||||
val networkId = Blockchain.fromNetworkId(networkSelectorValue.toNetworkId())?.id
|
||||
|
||||
val sameId = if (!token.isCustom) {
|
||||
// todo after move foundToken to CryptoCurrency model, use only id
|
||||
foundToken?.id == token.id.rawCurrencyId
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue