Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-17 15:05:25 +03:00
commit 00e8c20edb
4 changed files with 9 additions and 15 deletions

View file

@ -602,10 +602,13 @@ internal class AddCustomTokenViewModel @Inject constructor(
val networkSelectorValue = uiState.form.networkSelectorField.selectedItem.blockchain
val networkId = Blockchain.fromNetworkId(networkSelectorValue.toNetworkId())?.id
// todo after move foundToken to CryptoCurrency model, use only id
val savedTokenId = if (token.isCustom) null else token.id.rawCurrencyId
val sameId = if (!token.isCustom) {
// todo after move foundToken to CryptoCurrency model, use only id
foundToken?.id == token.id.rawCurrencyId
} else {
true
}
val sameId = foundToken?.id == savedTokenId
val sameAddress = contractAddress.equals(token.contractAddress, ignoreCase = true)
val sameBlockchain = networkId == token.network.id.value
val isSameDerivationPath = getDerivationPath()?.rawPath == token.network.derivationPath.value

View file

@ -73,9 +73,9 @@ private fun OrderCardButton(onClick: () -> Unit, modifier: Modifier = Modifier)
}
private val LightBgScanCardButtonColors: ButtonColors = TangemButtonColors(
backgroundColor = TangemColorPalette.Light2,
backgroundColor = TangemColorPalette.Light4,
contentColor = TangemColorPalette.Dark6,
disabledBackgroundColor = TangemColorPalette.Light2,
disabledBackgroundColor = TangemColorPalette.Dark5,
disabledContentColor = TangemColorPalette.Dark6,
)

View file

@ -2,7 +2,6 @@ package com.tangem.tap.features.send.ui
import androidx.lifecycle.*
import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase
import com.tangem.domain.balancehiding.ListenToFlipsUseCase
import com.tangem.domain.tokens.FetchPendingTransactionsUseCase
import com.tangem.domain.tokens.UpdateDelayedNetworkStatusUseCase
import com.tangem.domain.tokens.model.CryptoCurrency
@ -16,7 +15,6 @@ import com.tangem.tap.proxy.AppStateHolder
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
@ -30,7 +28,6 @@ internal class SendViewModel @Inject constructor(
private val dispatchers: CoroutineDispatcherProvider,
private val appStateHolder: AppStateHolder,
private val getBalanceHidingSettingsUseCase: GetBalanceHidingSettingsUseCase,
private val listenToFlipsUseCase: ListenToFlipsUseCase,
private val updateDelayedCurrencyStatusUseCase: UpdateDelayedNetworkStatusUseCase,
private val getSelectedWalletSyncUseCase: GetSelectedWalletSyncUseCase,
private val fetchPendingTransactionsUseCase: FetchPendingTransactionsUseCase,
@ -48,12 +45,6 @@ internal class SendViewModel @Inject constructor(
}
.flowOn(dispatchers.main)
.launchIn(viewModelScope)
viewModelScope.launch(dispatchers.main) {
listenToFlipsUseCase()
.flowWithLifecycle(owner.lifecycle)
.collect()
}
}
fun updateCurrencyDelayed() {

View file

@ -10,7 +10,7 @@
<color name="button_disabled">#303030</color>
<!--<color name="button_positive">#1ACE80</color>-->
<!--<color name="button_positive_disabled">#06311F</color>-->
<color name="button_primary">#F5F5F5</color>
<color name="button_primary">#FFC9C9C9</color>
<color name="button_secondary">#303030</color>
<color name="control_checked">#1ACE80</color>