diff --git a/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt b/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt index b8fd319359..ae52de34e5 100644 --- a/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt +++ b/app/src/main/java/com/tangem/tap/features/main/MainViewModel.kt @@ -48,10 +48,8 @@ import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.* import kotlinx.coroutines.launch -import kotlinx.coroutines.withTimeout import timber.log.Timber import javax.inject.Inject -import kotlin.time.Duration.Companion.seconds @Suppress("LongParameterList", "LargeClass") @HiltViewModel @@ -138,10 +136,7 @@ internal class MainViewModel @Inject constructor( viewModelScope.launch { launchAPIRequests { launch { blockchainSDKFactory.init() } - - launch { - withTimeout(timeMillis = 1.seconds.inWholeMilliseconds) { fetchUserCountry() } - } + launch { fetchUserCountry() } } subscribeToSelectedWallet() diff --git a/domain/promo/src/main/java/com/tangem/domain/promo/GetStoryContentUseCase.kt b/domain/promo/src/main/java/com/tangem/domain/promo/GetStoryContentUseCase.kt index 03a93bc23a..c1f4686134 100644 --- a/domain/promo/src/main/java/com/tangem/domain/promo/GetStoryContentUseCase.kt +++ b/domain/promo/src/main/java/com/tangem/domain/promo/GetStoryContentUseCase.kt @@ -7,6 +7,7 @@ import com.tangem.domain.promo.models.StoryContent import com.tangem.domain.promo.models.StoryContentIds import com.tangem.domain.settings.repositories.SettingsRepository import com.tangem.domain.settings.usercountry.models.needApplyFCARestrictions +import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.* import kotlin.time.Duration.Companion.seconds @@ -39,12 +40,14 @@ class GetStoryContentUseCase( } } + @OptIn(FlowPreview::class) private fun isFCAAllowed(id: String): Flow { return if (id == StoryContentIds.STORY_FIRST_TIME_SWAP.id) { settingsRepository.getUserCountryCode() .filterNotNull() - .timeout(5.seconds) + .timeout(3.seconds) .map { !it.needApplyFCARestrictions() } + .catch { emit(true) } } else { flowOf(true) }