Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-21 19:13:39 +03:00
parent ddb1b538c9
commit b1ce90e04e
5 changed files with 12 additions and 37 deletions

View file

@ -233,7 +233,7 @@ class DerivationManagerImpl(
}
scope.launch {
val selectedUserWallet = appStateHolder.userWalletsListManager?.selectedUserWalletSync
val selectedUserWallet = userWalletsListManager.selectedUserWalletSync
val result = appStateHolder.tangemSdkManager?.derivePublicKeys(
cardId = null, // always ignore cardId in derive task
@ -255,12 +255,10 @@ class DerivationManagerImpl(
derivedKeys = updatedDerivedKeys,
)
if (selectedUserWallet != null) {
val userWallet = selectedUserWallet.copy(
scanResponse = updatedScanResponse,
userWalletsListManager.update(
userWalletId = selectedUserWallet.walletId,
update = { it.copy(scanResponse = updatedScanResponse) },
)
appStateHolder.userWalletsListManager?.save(userWallet, canOverride = true)
appStateHolder.walletStoresManager?.fetch(userWallet, true)
}
appStateHolder.mainStore?.dispatchOnMain(GlobalAction.SaveScanResponse(updatedScanResponse))
delay(DELAY_SDK_DIALOG_CLOSE)

View file

@ -27,6 +27,7 @@ import com.tangem.tap.common.analytics.events.Basic
import com.tangem.tap.common.analytics.events.Basic.TransactionSent.MemoType
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.domain.TangemSigner
import com.tangem.tap.userWalletsListManager
import java.math.BigDecimal
import java.math.BigInteger
import java.math.MathContext
@ -416,7 +417,7 @@ class TransactionManagerImpl(
private suspend fun getActualWalletManager(blockchain: Blockchain, derivationPath: String?): WalletManager {
val walletManager = if (walletFeatureToggles.isRedesignedScreenEnabled) {
val selectedUserWallet = requireNotNull(
appStateHolder.userWalletsListManager?.selectedUserWalletSync,
userWalletsListManager.selectedUserWalletSync,
) { "userWallet or userWalletsListManager is null" }
walletManagersFacade.getOrCreateWalletManager(
selectedUserWallet.walletId,

View file

@ -10,7 +10,6 @@ import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.domain.common.extensions.toCoinId
import com.tangem.domain.common.extensions.toNetworkId
import com.tangem.domain.userwallets.UserWalletIdBuilder
import com.tangem.domain.walletmanager.WalletManagersFacade
import com.tangem.features.wallet.featuretoggles.WalletFeatureToggles
import com.tangem.lib.crypto.UserWalletManager
@ -90,11 +89,10 @@ class UserWalletManagerImpl(
}
override fun getWalletId(): String {
return appStateHolder.getActualCard()?.let {
UserWalletIdBuilder.card(it)
.build()
?.stringValue
} ?: ""
val selectedUserWallet = requireNotNull(
userWalletsListManager.selectedUserWalletSync,
) { "selectedUserWallet shouldn't be null" }
return selectedUserWallet.walletId.stringValue
}
override suspend fun isTokenAdded(currency: Currency, derivationPath: String?): Boolean {
@ -227,7 +225,7 @@ class UserWalletManagerImpl(
private suspend fun getActualWalletManager(blockchain: Blockchain, derivationPath: String?): WalletManager {
val walletManager = if (walletFeatureToggles.isRedesignedScreenEnabled) {
val selectedUserWallet = requireNotNull(
appStateHolder.userWalletsListManager?.selectedUserWalletSync,
userWalletsListManager.selectedUserWalletSync,
) { "userWallet or userWalletsListManager is null" }
walletManagersFacade.getOrCreateWalletManager(
selectedUserWallet.walletId,