Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-14 10:36:35 +03:00
commit 77f097766d
4 changed files with 11 additions and 9 deletions

View file

@ -165,6 +165,14 @@ internal class DefaultWalletStoresManager(
.build(),
)
}
.flatMapOnFailure { error ->
when (error) {
is WalletStoresError.WalletManagerNotCreated,
is WalletStoresError.UpdateWalletManagerError,
-> CompletionResult.Success(Unit)
else -> CompletionResult.Failure(error)
}
}
}
internal data class State(

View file

@ -11,7 +11,7 @@ data class UserWalletModel(
) {
sealed interface Type {
data class SingleCurrency(
val blockchainName: String?,
val blockchainName: String,
) : Type
data class MultiCurrency(

View file

@ -240,13 +240,7 @@ internal class WalletSelectorMiddleware {
is UserWalletModel.Type.MultiCurrency -> type.copy(
tokensCount = walletStores.flatMap { it.walletsData }.size,
)
is UserWalletModel.Type.SingleCurrency -> type.copy(
blockchainName = walletStores
.firstOrNull()
?.blockchainNetwork
?.blockchain
?.fullName,
)
is UserWalletModel.Type.SingleCurrency -> type
},
fiatBalance = totalFiatBalanceCalculator.calculate(
prevAmount = fiatBalance.amount,

View file

@ -103,7 +103,7 @@ internal object WalletSelectorReducer {
)
} else {
UserWalletModel.Type.SingleCurrency(
blockchainName = (prevType as? UserWalletModel.Type.SingleCurrency)?.blockchainName,
blockchainName = scanResponse.getBlockchain().fullName,
)
}
}