Updated on 2026-08-14

This commit is contained in:
Tangem 2023-04-17 18:50:30 +03:00
parent 4f927cad74
commit 3184928866
3 changed files with 2 additions and 5 deletions

View file

@ -8,7 +8,6 @@ import com.tangem.tap.common.redux.global.CryptoCurrencyName
import com.tangem.tap.common.toggleWidget.WidgetState
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
import com.tangem.tap.domain.model.TotalFiatBalance
import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletDataModel
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
@ -19,7 +18,6 @@ import org.rekotlin.StateType
import kotlin.properties.ReadOnlyProperty
data class WalletState(
val userWallet: UserWallet? = null,
val state: ProgressState = ProgressState.Done,
val error: ErrorType? = null,
val cardImage: Artwork? = null,

View file

@ -105,7 +105,7 @@ class WalletMiddleware {
scope.launch {
when (val result = tangemSdkManager.createWallet(globalState.scanResponse?.card?.cardId)) {
is CompletionResult.Success -> {
val selectedUserWallet = walletState.userWallet.guard {
val selectedUserWallet = userWalletsListManager.selectedUserWalletSync.guard {
Timber.e("Unable to create wallet, no user wallet selected")
return@launch
}
@ -131,7 +131,7 @@ class WalletMiddleware {
is WalletAction.LoadData,
is WalletAction.LoadData.Refresh,
-> {
val selectedWallet = walletState.userWallet.guard {
val selectedWallet = userWalletsListManager.selectedUserWalletSync.guard {
Timber.e("Unable to load/refresh wallets data, no user wallet selected")
return
}

View file

@ -73,7 +73,6 @@ private fun internalReduce(action: Action, state: AppState, appStateHolder: AppS
is WalletAction.UserWalletChanged -> with(action.userWallet) {
val card = scanResponse.card
newState = WalletState(
userWallet = this,
isMultiwalletAllowed = isMultiCurrency,
cardImage = Artwork(
artworkId = artworkUrl,