From 97890ac7501722963bdf32845d0bd5ca4130adfd Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 9 Oct 2023 22:31:12 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../presentation/wallet/state/factory/WalletStateFactory.kt | 2 -- .../state/factory/txhistory/WalletLoadedTxHistoryConverter.kt | 2 -- .../factory/txhistory/WalletTxHistoryItemFlowConverter.kt | 2 -- .../txhistory/WalletTxHistoryTransactionStateConverter.kt | 3 --- .../wallet/presentation/wallet/viewmodels/WalletViewModel.kt | 3 --- 5 files changed, 12 deletions(-) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/WalletStateFactory.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/WalletStateFactory.kt index d904986cb5..1c13a73e30 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/WalletStateFactory.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/WalletStateFactory.kt @@ -45,7 +45,6 @@ internal class WalletStateFactory( private val currentCardTypeResolverProvider: Provider, private val currentWalletProvider: Provider, private val appCurrencyProvider: Provider, - private val isBalanceHiddenProvider: Provider, private val clickIntents: WalletClickIntents, ) { @@ -94,7 +93,6 @@ internal class WalletStateFactory( private val loadedTxHistoryConverter by lazy { WalletLoadedTxHistoryConverter( currentStateProvider = currentStateProvider, - isBalanceHiddenProvider = isBalanceHiddenProvider, currentCardTypeResolverProvider = currentCardTypeResolverProvider, clickIntents = clickIntents, ) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletLoadedTxHistoryConverter.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletLoadedTxHistoryConverter.kt index 7d2636f3a2..202fcc3ae5 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletLoadedTxHistoryConverter.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletLoadedTxHistoryConverter.kt @@ -27,7 +27,6 @@ internal class WalletLoadedTxHistoryConverter( private val currentStateProvider: Provider, private val currentCardTypeResolverProvider: Provider, private val clickIntents: WalletClickIntents, - private val isBalanceHiddenProvider: Provider, ) : Converter>>, WalletState> { private val walletTxHistoryItemFlowConverter by lazy { @@ -35,7 +34,6 @@ internal class WalletLoadedTxHistoryConverter( currentStateProvider = currentStateProvider, blockchain = currentCardTypeResolverProvider().getBlockchain(), clickIntents = clickIntents, - isBalanceHiddenProvider = isBalanceHiddenProvider, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryItemFlowConverter.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryItemFlowConverter.kt index 2789256422..0c5b962d71 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryItemFlowConverter.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryItemFlowConverter.kt @@ -35,7 +35,6 @@ import org.joda.time.DateTimeZone */ internal class WalletTxHistoryItemFlowConverter( private val currentStateProvider: Provider, - private val isBalanceHiddenProvider: Provider, private val blockchain: Blockchain, private val clickIntents: WalletClickIntents, ) : Converter>, TxHistoryState?> { @@ -44,7 +43,6 @@ internal class WalletTxHistoryItemFlowConverter( WalletTxHistoryTransactionStateConverter( symbol = blockchain.currency, decimals = blockchain.decimals(), - isBalanceHiddenProvider = isBalanceHiddenProvider, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryTransactionStateConverter.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryTransactionStateConverter.kt index c4af843d2b..5c953517fe 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryTransactionStateConverter.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/factory/txhistory/WalletTxHistoryTransactionStateConverter.kt @@ -13,7 +13,6 @@ import com.tangem.utils.toFormattedCurrencyString class WalletTxHistoryTransactionStateConverter( private val symbol: String, private val decimals: Int, - private val isBalanceHiddenProvider: Provider, ) : Converter { override fun convert(value: TxHistoryItem): TransactionState { @@ -146,8 +145,6 @@ class WalletTxHistoryTransactionStateConverter( } private fun TxHistoryItem.getAmount(): String { - if (isBalanceHiddenProvider()) return Strings.STARS - val prefix = when (direction) { is TxHistoryItem.TransactionDirection.Incoming -> "+" is TxHistoryItem.TransactionDirection.Outgoing -> "-" diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt index e6cf464d0f..720cad8f50 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt @@ -126,7 +126,6 @@ internal class WalletViewModel @Inject constructor( var router: InnerWalletRouter by Delegates.notNull() private val selectedAppCurrencyFlow: StateFlow = createSelectedAppCurrencyFlow() - private var isBalanceHidden = true private val notificationsListFactory = WalletNotificationsListFactory( wasCardScannedUseCase = wasCardScannedUseCase, @@ -147,7 +146,6 @@ internal class WalletViewModel @Inject constructor( wallets[requireNotNull(uiState as? WalletState.ContentState).walletsListConfig.selectedWalletIndex] }, appCurrencyProvider = Provider(selectedAppCurrencyFlow::value), - isBalanceHiddenProvider = Provider { isBalanceHidden }, clickIntents = this, ) @@ -190,7 +188,6 @@ internal class WalletViewModel @Inject constructor( isBalanceHiddenUseCase() .flowWithLifecycle(owner.lifecycle) .onEach { hidden -> - isBalanceHidden = hidden WalletStateCache.updateAll { copySealed(isBalanceHidden = hidden) } uiState = stateFactory.getHiddenBalanceState(isBalanceHidden = hidden) }