From f3e7d4b0f639d3d264d6aef1b417ec1010e34aee Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 13 Jan 2026 14:21:40 +0700 Subject: [PATCH] Updated on 2026-08-14 --- .../walletsettings/model/WalletSettingsModel.kt | 2 +- .../walletsettings/utils/AccountItemsDelegate.kt | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt index b5ba400298..dbab06d6f6 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt @@ -200,7 +200,7 @@ internal class WalletSettingsModel @Inject constructor( isUpgradeNotificationEnabled: Boolean, accountList: List, ): PersistentList { - val isAccountsFeatureEnabled = accountsFeatureToggles.isFeatureEnabled + val isAccountsFeatureEnabled = accountItemsDelegate.isAccountsSupported(userWallet) val isMultiCurrency = when (userWallet) { is UserWallet.Cold -> userWallet.isMultiCurrency is UserWallet.Hot -> true diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/utils/AccountItemsDelegate.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/utils/AccountItemsDelegate.kt index 0d40442830..aa4c1a4b46 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/utils/AccountItemsDelegate.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/utils/AccountItemsDelegate.kt @@ -16,7 +16,6 @@ import com.tangem.domain.account.featuretoggle.AccountsFeatureToggles import com.tangem.domain.account.models.AccountList import com.tangem.domain.account.models.AccountStatusList import com.tangem.domain.account.status.supplier.SingleAccountStatusListSupplier -import com.tangem.domain.account.usecase.IsAccountsModeEnabledUseCase import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase import com.tangem.domain.appcurrency.model.AppCurrency import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase @@ -45,7 +44,6 @@ internal class AccountItemsDelegate @Inject constructor( private val singleAccountStatusListSupplier: SingleAccountStatusListSupplier, private val getBalanceHidingSettingsUseCase: GetBalanceHidingSettingsUseCase, private val getSelectedAppCurrencyUseCase: GetSelectedAppCurrencyUseCase, - private val isAccountsModeEnabledUseCase: IsAccountsModeEnabledUseCase, private val accountListSortingSaver: AccountListSortingSaver, private val accountsFeatureToggles: AccountsFeatureToggles, private val analyticsEventHandler: AnalyticsEventHandler, @@ -53,15 +51,16 @@ internal class AccountItemsDelegate @Inject constructor( private val userWalletId = paramsContainer.require().userWalletId + fun isAccountsSupported(wallet: UserWallet) = accountsFeatureToggles.isFeatureEnabled && wallet.isAccountsSupported + fun loadAccount(wallet: UserWallet): Flow> { - if (!accountsFeatureToggles.isFeatureEnabled || !wallet.isAccountsSupported) return flowOf(emptyList()) + if (!isAccountsSupported(wallet)) return flowOf(emptyList()) return combine( flow = singleAccountStatusListSupplier(userWalletId), flow2 = getSelectedAppCurrencyUseCase.invokeOrDefault(), flow3 = getBalanceHidingSettingsUseCase.isBalanceHidden(), - flow4 = isAccountsModeEnabledUseCase(), - flow5 = accountListSortingSaver.accountsOrderFlow, + flow4 = accountListSortingSaver.accountsOrderFlow, transform = ::buildUiList, ) } @@ -70,7 +69,6 @@ internal class AccountItemsDelegate @Inject constructor( accountStatusList: AccountStatusList, appCurrency: AppCurrency, isBalanceHidden: Boolean, - isAccountsMode: Boolean, accountsOrder: List?, ): List = buildList { fun AccountStatus.CryptoPortfolio.mapCryptoPortfolio(): WalletSettingsAccountsUM { @@ -98,10 +96,7 @@ internal class AccountItemsDelegate @Inject constructor( ) add(header) - - if (isAccountsMode) { - addAll(accounts.map(::mapAccount).applySortingOrder(order = accountsOrder)) - } + addAll(accounts.map(::mapAccount).applySortingOrder(order = accountsOrder)) val isAddAccountEnabled = accounts.size < AccountList.MAX_ACCOUNTS_COUNT val shouldShowDescription = accounts.size > 1