Updated on 2026-08-14
This commit is contained in:
parent
1959636f2e
commit
4b62c933bf
17 changed files with 48 additions and 49 deletions
|
|
@ -10,7 +10,6 @@ import com.tangem.domain.appcurrency.model.AppCurrency
|
|||
import com.tangem.domain.models.StatusSource
|
||||
import com.tangem.domain.models.TotalFiatBalance
|
||||
import com.tangem.domain.models.account.Account
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.utils.converter.Converter
|
||||
|
||||
class AccountPortfolioItemUMConverter(
|
||||
|
|
@ -25,7 +24,7 @@ class AccountPortfolioItemUMConverter(
|
|||
override fun convert(value: Account): UserWalletItemUM {
|
||||
return with(value) {
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId(accountId.value),
|
||||
id = accountId.value,
|
||||
name = accountName.toUM().value,
|
||||
information = getInfo(account = this),
|
||||
balance = getBalanceInfo(),
|
||||
|
|
|
|||
|
|
@ -37,10 +37,12 @@ import com.tangem.core.ui.components.account.AccountIconSize
|
|||
import com.tangem.core.ui.components.block.BlockCard
|
||||
import com.tangem.core.ui.components.block.TangemBlockCardColors
|
||||
import com.tangem.core.ui.components.text.applyBladeBrush
|
||||
import com.tangem.core.ui.extensions.*
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.utils.StringsSigns.DASH_SIGN
|
||||
import com.tangem.utils.StringsSigns.DOT
|
||||
import com.tangem.utils.StringsSigns.THREE_STARS
|
||||
|
|
@ -322,7 +324,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
override val values: Sequence<UserWalletItemUM>
|
||||
get() = sequenceOf(
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_0".encodeToByteArray()),
|
||||
id = "user_wallet_0",
|
||||
name = stringReference("Mobile Wallet"),
|
||||
information = getInformation(cardCount = 1),
|
||||
balance = UserWalletItemUM.Balance.Locked,
|
||||
|
|
@ -331,7 +333,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_1".encodeToByteArray()),
|
||||
id = "user_wallet_1",
|
||||
name = stringReference("My Wallet"),
|
||||
information = getInformation(cardCount = 1),
|
||||
balance = UserWalletItemUM.Balance.Locked,
|
||||
|
|
@ -339,7 +341,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_2".encodeToByteArray()),
|
||||
id = "user_wallet_2",
|
||||
name = stringReference("Old wallet"),
|
||||
information = getInformation(cardCount = 2),
|
||||
balance = UserWalletItemUM.Balance.Hidden,
|
||||
|
|
@ -348,7 +350,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
endIcon = UserWalletItemUM.EndIcon.Arrow,
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.Failed,
|
||||
|
|
@ -357,7 +359,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.Loading,
|
||||
|
|
@ -366,7 +368,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = UserWalletItemUM.Information.Loading,
|
||||
balance = UserWalletItemUM.Balance.Loading,
|
||||
|
|
@ -375,7 +377,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.Loaded(
|
||||
|
|
@ -387,7 +389,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.Loaded(
|
||||
|
|
@ -399,7 +401,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = UserWalletItemUM.Information.Loading,
|
||||
balance = UserWalletItemUM.Balance.Loaded(
|
||||
|
|
@ -410,7 +412,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = UserWalletItemUM.Information.Failed,
|
||||
balance = UserWalletItemUM.Balance.Loaded(
|
||||
|
|
@ -421,7 +423,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = UserWalletItemUM.Information.Failed,
|
||||
balance = UserWalletItemUM.Balance.Loaded(
|
||||
|
|
@ -433,7 +435,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.NotShowing,
|
||||
|
|
@ -442,7 +444,7 @@ private class UserWalletItemUMPreviewProvider : PreviewParameterProvider<UserWal
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_4".encodeToByteArray()),
|
||||
id = "user_wallet_4",
|
||||
name = stringReference("Main account"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.NotShowing,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class UserWalletItemUMConverter(
|
|||
override fun convert(value: UserWallet): UserWalletItemUM {
|
||||
return with(value) {
|
||||
UserWalletItemUM(
|
||||
id = walletId,
|
||||
id = walletId.stringValue,
|
||||
name = stringReference(name),
|
||||
information = getInfo(userWallet = this),
|
||||
balance = getBalanceInfo(userWallet = this),
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ package com.tangem.common.ui.userwallet.state
|
|||
import com.tangem.common.ui.account.CryptoPortfolioIconUM
|
||||
import com.tangem.core.ui.components.artwork.ArtworkUM
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import javax.annotation.concurrent.Immutable
|
||||
|
||||
@Immutable
|
||||
data class UserWalletItemUM(
|
||||
val id: UserWalletId,
|
||||
val id: String,
|
||||
val name: TextReference,
|
||||
val information: Information,
|
||||
val balance: Balance,
|
||||
|
|
@ -25,6 +24,7 @@ data class UserWalletItemUM(
|
|||
Warning,
|
||||
}
|
||||
|
||||
@Immutable
|
||||
sealed class Balance {
|
||||
|
||||
data object Hidden : Balance()
|
||||
|
|
@ -43,6 +43,7 @@ data class UserWalletItemUM(
|
|||
) : Balance()
|
||||
}
|
||||
|
||||
@Immutable
|
||||
sealed class Information {
|
||||
|
||||
data object Failed : Information()
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ private fun Preview_TooltipText() {
|
|||
) {
|
||||
TooltipText(
|
||||
text = stringReference("Text"),
|
||||
onInfoClick = { /* [REDACTED_TODO_COMMENT]*/ },
|
||||
onInfoClick = { },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -602,7 +602,6 @@ internal class DefaultCurrenciesRepository(
|
|||
return demoConfig.isDemoCardId(userWallet.cardId) && response == null
|
||||
}
|
||||
|
||||
// TODO [REDACTED_JIRA]
|
||||
private suspend fun fetchExpressAssetsByNetworkIds(userWallet: UserWallet, userTokens: UserTokensResponse) {
|
||||
val tokens = userTokens.tokens.mapTo(hashSetOf()) { token ->
|
||||
ExpressAsset.ID(
|
||||
|
|
|
|||
|
|
@ -23,6 +23,6 @@ sealed interface PortfolioSelectorItemUM {
|
|||
val item: UserWalletItemUM,
|
||||
val isSelected: Boolean,
|
||||
) : PortfolioSelectorItemUM {
|
||||
override val id: String = item.id.stringValue
|
||||
override val id: String = item.id
|
||||
}
|
||||
}
|
||||
|
|
@ -32,7 +32,6 @@ import com.tangem.core.ui.extensions.resourceReference
|
|||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.features.account.impl.R
|
||||
import com.tangem.features.account.selector.entity.PortfolioSelectorItemUM
|
||||
import com.tangem.features.account.selector.entity.PortfolioSelectorUM
|
||||
|
|
@ -132,7 +131,7 @@ internal object PortfolioSelectorPreviewData {
|
|||
|
||||
private val accountItem: UserWalletItemUM
|
||||
get() = UserWalletItemUM(
|
||||
id = UserWalletId(UUID.randomUUID().toString().encodeToByteArray()),
|
||||
id = UUID.randomUUID().toString(),
|
||||
name = accountName,
|
||||
information = UserWalletItemUM.Information.Loaded(stringReference("12 tokens")),
|
||||
balance = UserWalletItemUM.Balance.Loaded("$726.04", false),
|
||||
|
|
@ -149,7 +148,7 @@ internal object PortfolioSelectorPreviewData {
|
|||
|
||||
private val walletItem: UserWalletItemUM
|
||||
get() = UserWalletItemUM(
|
||||
id = UserWalletId(UUID.randomUUID().toString().encodeToByteArray()),
|
||||
id = UUID.randomUUID().toString(),
|
||||
name = walletName,
|
||||
information = UserWalletItemUM.Information.Loaded(stringReference("12 tokens")),
|
||||
balance = UserWalletItemUM.Balance.Loaded("$726.04", false),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import com.tangem.core.ui.extensions.TextReference
|
|||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.features.details.component.UserWalletListComponent
|
||||
import com.tangem.features.details.entity.UserWalletListUM
|
||||
import com.tangem.features.details.impl.R
|
||||
|
|
@ -25,7 +24,7 @@ internal class PreviewUserWalletListComponent : UserWalletListComponent {
|
|||
UserWalletListUM(
|
||||
userWallets = persistentListOf(
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_1".encodeToByteArray()),
|
||||
id = "user_wallet_1",
|
||||
name = stringReference("My Wallet"),
|
||||
information = getInformation(cardCount = 1),
|
||||
balance = UserWalletItemUM.Balance.Loading,
|
||||
|
|
@ -33,7 +32,7 @@ internal class PreviewUserWalletListComponent : UserWalletListComponent {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_2".encodeToByteArray()),
|
||||
id = "user_wallet_2",
|
||||
name = stringReference("Old wallet"),
|
||||
information = getInformation(cardCount = 2),
|
||||
balance = UserWalletItemUM.Balance.Loading,
|
||||
|
|
@ -41,7 +40,7 @@ internal class PreviewUserWalletListComponent : UserWalletListComponent {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = getInformation(cardCount = 3),
|
||||
balance = UserWalletItemUM.Balance.Loading,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
|
|||
import com.tangem.core.ui.components.rows.model.BlockchainRowUM
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.features.markets.impl.R
|
||||
import com.tangem.features.markets.portfolio.impl.ui.state.AddToPortfolioBSContentUM
|
||||
import com.tangem.features.markets.portfolio.impl.ui.state.SelectNetworkUM
|
||||
|
|
@ -24,7 +23,7 @@ internal class PreviewAddToPortfolioBSContentProvider : PreviewParameterProvider
|
|||
)
|
||||
|
||||
val userWallet = UserWalletItemUM(
|
||||
id = UserWalletId("1"),
|
||||
id = "1",
|
||||
name = stringReference("Wallet 1"),
|
||||
information = UserWalletItemUM.Information.Loaded(TextReference.Str("3 cards")),
|
||||
balance = UserWalletItemUM.Balance.Loading,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ internal class PreviewWalletSettingsComponent : WalletSettingsComponent {
|
|||
|
||||
private val accountItem: UserWalletItemUM
|
||||
get() = UserWalletItemUM(
|
||||
id = UserWalletId(UUID.randomUUID().toString().encodeToByteArray()),
|
||||
id = UUID.randomUUID().toString(),
|
||||
name = accountName,
|
||||
information = UserWalletItemUM.Information.Loaded(stringReference("12 tokens")),
|
||||
balance = UserWalletItemUM.Balance.Loaded("$726.04", false),
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ internal sealed class WalletSettingsAccountsUM : WalletSettingsItemUM() {
|
|||
data class Account(
|
||||
val state: UserWalletItemUM,
|
||||
) : WalletSettingsAccountsUM() {
|
||||
override val id: String get() = state.id.stringValue
|
||||
override val id: String = state.id
|
||||
}
|
||||
|
||||
data class Footer(
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
val id = (it as? WalletSettingsAccountsUM.Account)?.state?.id
|
||||
?: return@mapNotNull null
|
||||
|
||||
AccountId.forCryptoPortfolio(userWalletId = params.userWalletId, value = id.stringValue).getOrNull()
|
||||
AccountId.forCryptoPortfolio(userWalletId = params.userWalletId, value = id).getOrNull()
|
||||
}
|
||||
|
||||
accountListSortingSaver.save(accountIds = accountIds)
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ private fun Content(state: WalletSettingsUM, modifier: Modifier = Modifier) {
|
|||
items(
|
||||
items = state.items,
|
||||
key = WalletSettingsItemUM::id,
|
||||
contentType = { it::class.java },
|
||||
) { item ->
|
||||
val offsetModifier = when (item) {
|
||||
is WalletSettingsAccountsUM.Account,
|
||||
|
|
@ -335,6 +336,7 @@ private fun LazyItemScope.AccountItem(
|
|||
ReorderableItem(
|
||||
state = reorderableListState,
|
||||
key = model.id,
|
||||
modifier = modifier,
|
||||
) { isDragging ->
|
||||
val elevation by animateDpAsState(if (isDragging) 9.dp else 0.dp)
|
||||
val scale by animateFloatAsState(if (isDragging) 1.04f else 1f)
|
||||
|
|
@ -343,7 +345,7 @@ private fun LazyItemScope.AccountItem(
|
|||
Surface(
|
||||
shape = RoundedCornerShape(shapeRadius),
|
||||
shadowElevation = elevation,
|
||||
modifier = modifier.scale(scale),
|
||||
modifier = Modifier.scale(scale),
|
||||
) {
|
||||
UserWalletItem(
|
||||
state = model.state,
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ private fun WcSelectWalletContent(
|
|||
val baseModifier = Modifier
|
||||
.clip(RoundedCornerShape(14.dp))
|
||||
.clickable(onClick = state.onClick)
|
||||
val itemModifier = if (state.id == selectedWalletId) {
|
||||
val itemModifier = if (state.id == selectedWalletId.stringValue) {
|
||||
baseModifier.border(
|
||||
width = 1.dp,
|
||||
color = TangemTheme.colors.text.accent,
|
||||
|
|
@ -148,7 +148,7 @@ private fun WcSelectWalletContent(
|
|||
private fun WcSelectWalletContent_Preview() {
|
||||
val wallets = persistentListOf(
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_1".encodeToByteArray()),
|
||||
id = "user_wallet_1",
|
||||
name = stringReference("Tangem 2.0"),
|
||||
information = getInformation(42),
|
||||
balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false),
|
||||
|
|
@ -156,7 +156,7 @@ private fun WcSelectWalletContent_Preview() {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_2".encodeToByteArray()),
|
||||
id = "user_wallet_2",
|
||||
name = stringReference("Tangem White"),
|
||||
information = getInformation(24),
|
||||
balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false),
|
||||
|
|
@ -164,7 +164,7 @@ private fun WcSelectWalletContent_Preview() {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Bitcoin"),
|
||||
information = getInformation(1),
|
||||
balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false),
|
||||
|
|
@ -172,7 +172,7 @@ private fun WcSelectWalletContent_Preview() {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_4".encodeToByteArray()),
|
||||
id = "user_wallet_4",
|
||||
name = stringReference("Tangem 1.0"),
|
||||
information = getInformation(21),
|
||||
balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false),
|
||||
|
|
@ -180,7 +180,7 @@ private fun WcSelectWalletContent_Preview() {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_4".encodeToByteArray()),
|
||||
id = "user_wallet_4",
|
||||
name = stringReference("Tangem 1.0"),
|
||||
information = UserWalletItemUM.Information.Loading,
|
||||
balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false),
|
||||
|
|
@ -188,7 +188,7 @@ private fun WcSelectWalletContent_Preview() {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_4".encodeToByteArray()),
|
||||
id = "user_wallet_4",
|
||||
name = stringReference("Tangem 1.0"),
|
||||
information = UserWalletItemUM.Information.Failed,
|
||||
balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false),
|
||||
|
|
@ -199,7 +199,7 @@ private fun WcSelectWalletContent_Preview() {
|
|||
TangemThemePreview {
|
||||
WcSelectWalletModalBS(
|
||||
wallets = wallets,
|
||||
selectedWalletId = wallets.first().id,
|
||||
selectedWalletId = UserWalletId(wallets.first().id.encodeToByteArray()),
|
||||
onBack = {},
|
||||
onDismiss = {},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import com.tangem.core.decompose.di.ModelScoped
|
|||
import com.tangem.core.decompose.ui.UiMessageSender
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.domain.tokens.GetTokenListUseCase
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.tokens.GetTokenListUseCase
|
||||
import com.tangem.features.wallet.utils.UserWalletsFetcher
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
|
|
@ -41,7 +41,7 @@ internal class WcUserWalletsFetcher(
|
|||
}
|
||||
|
||||
private fun getTokenListFlow(walletItem: UserWalletItemUM): Flow<UserWalletItemUM> {
|
||||
return getTokenListUseCase.launch(walletItem.id).map { lce ->
|
||||
return getTokenListUseCase.launch(UserWalletId(walletItem.id)).map { lce ->
|
||||
val information = lce.fold(
|
||||
ifLoading = { UserWalletItemUM.Information.Loading },
|
||||
ifError = { UserWalletItemUM.Information.Failed },
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import com.tangem.common.ui.userwallet.state.UserWalletItemUM
|
|||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.features.welcome.impl.ui.state.WelcomeUM
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
||||
|
|
@ -48,7 +47,7 @@ private fun Preview() {
|
|||
val state = WelcomeUM.SelectWallet(
|
||||
wallets = persistentListOf(
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = UserWalletItemUM.Information.Loading,
|
||||
balance = UserWalletItemUM.Balance.Loaded(
|
||||
|
|
@ -59,7 +58,7 @@ private fun Preview() {
|
|||
onClick = {},
|
||||
),
|
||||
UserWalletItemUM(
|
||||
id = UserWalletId("user_wallet_3".encodeToByteArray()),
|
||||
id = "user_wallet_3",
|
||||
name = stringReference("Multi Card"),
|
||||
information = UserWalletItemUM.Information.Failed,
|
||||
imageState = UserWalletItemUM.ImageState.MobileWallet,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue