Updated on 2026-08-14
This commit is contained in:
parent
52682a12f0
commit
74dea8f85b
1 changed files with 7 additions and 2 deletions
|
|
@ -510,7 +510,7 @@ internal class AddCustomTokenViewModel @Inject constructor(
|
|||
val sameAddress = contractAddress == wrappedCurrency.token.contractAddress
|
||||
val sameBlockchain =
|
||||
Blockchain.fromNetworkId(networkSelectorValue.toNetworkId()) == wrappedCurrency.blockchain
|
||||
val isSameDerivationPath = getDerivationPath()?.rawPath == wrappedCurrency.derivationPath
|
||||
val isSameDerivationPath = getDerivationPath().isSameDerivationPath(wrappedCurrency.derivationPath)
|
||||
sameId && sameAddress && sameBlockchain && isSameDerivationPath
|
||||
}
|
||||
}
|
||||
|
|
@ -522,10 +522,15 @@ internal class AddCustomTokenViewModel @Inject constructor(
|
|||
.filterIsInstance<Currency.Blockchain>()
|
||||
.any {
|
||||
val networkSelectorValue = uiState.form.networkSelectorField.selectedItem.blockchain
|
||||
networkSelectorValue == it.blockchain && getDerivationPath()?.rawPath == it.derivationPath
|
||||
networkSelectorValue == it.blockchain &&
|
||||
getDerivationPath().isSameDerivationPath(it.derivationPath)
|
||||
}
|
||||
}
|
||||
|
||||
private fun DerivationPath?.isSameDerivationPath(rawDerivationPath: String?): Boolean {
|
||||
return this == rawDerivationPath?.let { DerivationPath(it) }
|
||||
}
|
||||
|
||||
private fun handleContractAddressErrorValidation(type: AddCustomTokenError) {
|
||||
when {
|
||||
isNetworkSelected() && type == AddCustomTokenError.InvalidContractAddress -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue