Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-27 07:24:44 -07:00
parent 819a80a444
commit d40822e994
33 changed files with 47 additions and 182 deletions

View file

@ -1,11 +1,5 @@
package com.tangem.feature.swap
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.features.swap.SwapFeatureToggles
internal class DefaultSwapFeatureToggles(
private val featureToggles: FeatureTogglesManager,
) : SwapFeatureToggles {
override val isPromoStoriesEnabled: Boolean
get() = featureToggles.isFeatureEnabled("SWAP_STORIES_ENABLED")
}
internal class DefaultSwapFeatureToggles : SwapFeatureToggles

View file

@ -1,6 +1,5 @@
package com.tangem.feature.swap.di
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.feature.swap.DefaultSwapComponent
import com.tangem.feature.swap.DefaultSwapFeatureToggles
import com.tangem.features.swap.SwapComponent
@ -18,8 +17,8 @@ internal object SwapFeatureModule {
@Provides
@Singleton
fun provideSwapFeatureToggles(featureToggles: FeatureTogglesManager): SwapFeatureToggles {
return DefaultSwapFeatureToggles(featureToggles)
fun provideSwapFeatureToggles(): SwapFeatureToggles {
return DefaultSwapFeatureToggles()
}
}

View file

@ -56,7 +56,6 @@ import com.tangem.feature.swap.router.SwapRouter
import com.tangem.feature.swap.ui.StateBuilder
import com.tangem.feature.swap.utils.formatToUIRepresentation
import com.tangem.features.swap.SwapComponent
import com.tangem.features.swap.SwapFeatureToggles
import com.tangem.utils.Provider
import com.tangem.utils.coroutines.*
import com.tangem.utils.isNullOrZero
@ -96,7 +95,6 @@ internal class SwapModel @Inject constructor(
private val getMinimumTransactionAmountSyncUseCase: GetMinimumTransactionAmountSyncUseCase,
private val shouldShowStoriesUseCase: ShouldShowStoriesUseCase,
private val getStoryContentUseCase: GetStoryContentUseCase,
private val featureToggles: SwapFeatureToggles,
getBalanceHidingSettingsUseCase: GetBalanceHidingSettingsUseCase,
swapInteractorFactory: SwapInteractor.Factory,
private val urlOpener: UrlOpener,
@ -166,10 +164,8 @@ internal class SwapModel @Inject constructor(
init {
modelScope.launch {
if (featureToggles.isPromoStoriesEnabled) {
initStories()
swapRouter.openScreen(SwapNavScreen.PromoStories)
}
initStories()
swapRouter.openScreen(SwapNavScreen.PromoStories)
}
modelScope.launch(dispatchers.io) {
val fromStatus = getCryptoCurrencyStatusUseCase(userWalletId, initialCurrencyFrom.id).getOrNull()