Updated on 2026-08-14
This commit is contained in:
commit
45156f05b0
1184 changed files with 47887 additions and 11982 deletions
|
|
@ -35,7 +35,6 @@ import com.tangem.features.details.entity.SelectEmailFeedbackTypeBS
|
|||
import com.tangem.features.details.utils.ItemsBuilder
|
||||
import com.tangem.features.details.utils.SocialsBuilder
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.tangempay.TangemPayFeatureToggles
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.version.AppVersionProvider
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
|
|
@ -71,7 +70,6 @@ internal class DetailsModel @Inject constructor(
|
|||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
private val tangemPayEligibilityManager: TangemPayEligibilityManager,
|
||||
private val tangemPayFeatureToggles: TangemPayFeatureToggles,
|
||||
) : Model() {
|
||||
|
||||
private val params: DetailsComponent.Params = paramsContainer.require()
|
||||
|
|
@ -249,7 +247,6 @@ internal class DetailsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun addTangemPayItemIfEligible() {
|
||||
if (!tangemPayFeatureToggles.isEntryPointsEnabled) return
|
||||
modelScope.launch {
|
||||
val isEligible = tangemPayEligibilityManager
|
||||
.getEligibleWallets(shouldExcludePaeraCustomers = true)
|
||||
|
|
|
|||
|
|
@ -23,10 +23,7 @@ import com.tangem.features.wallet.utils.UserWalletsFetcher
|
|||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
|
@ -65,13 +62,18 @@ internal class UserWalletListModel @Inject constructor(
|
|||
)
|
||||
|
||||
init {
|
||||
combine(
|
||||
flow = userWalletsFetcher.userWallets,
|
||||
flow2 = shouldSaveUserWalletsUseCase(),
|
||||
flow3 = isWalletSavingInProgress,
|
||||
) { userWallets, shouldSaveUserWallets, isWalletSavingInProgress ->
|
||||
updateState(userWallets, shouldSaveUserWallets, isWalletSavingInProgress)
|
||||
}.launchIn(modelScope)
|
||||
modelScope.launch {
|
||||
val userWalletsFlow = userWalletsFetcher.userWallets.stateIn(this)
|
||||
state.update { value -> value.copy(userWallets = userWalletsFlow.value) }
|
||||
|
||||
combine(
|
||||
flow = userWalletsFlow,
|
||||
flow2 = shouldSaveUserWalletsUseCase(),
|
||||
flow3 = isWalletSavingInProgress,
|
||||
) { userWallets, shouldSaveUserWallets, isWalletSavingInProgress ->
|
||||
updateState(userWallets, shouldSaveUserWallets, isWalletSavingInProgress)
|
||||
}.collect()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateState(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue