Updated on 2026-08-14
This commit is contained in:
parent
7e4dc3dbb4
commit
8f7f7c85ca
2 changed files with 6 additions and 8 deletions
|
|
@ -84,11 +84,12 @@ class GetCurrencyWarningsUseCase(
|
|||
): Flow<CryptoCurrencyWarning?> {
|
||||
val currency = currencyStatus.currency
|
||||
val cryptoStatuses = operations.getCurrenciesStatusesSync()
|
||||
val promoBanner = promoRepository.getChangellyPromoBanner()
|
||||
return combine(
|
||||
showSwapPromoTokenUseCase().conflate(),
|
||||
flowOf(marketCryptoCurrencyRepository.isExchangeable(userWalletId, currency)).conflate(),
|
||||
) { shouldShowSwapPromo, isExchangeable ->
|
||||
val promoBanner = promoRepository.getChangellyPromoBanner() ?: return@combine null
|
||||
promoBanner ?: return@combine null
|
||||
val showPromo = promoBanner.isActive && shouldShowSwapPromo
|
||||
if (showPromo && isExchangeable && currencyStatus.value !is CryptoCurrencyStatus.Unreachable) {
|
||||
cryptoStatuses.fold(
|
||||
|
|
|
|||
|
|
@ -22,10 +22,7 @@ import dagger.hilt.android.scopes.ViewModelScoped
|
|||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.conflate
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.flow.*
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
@ -54,14 +51,14 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
|
||||
val cardTypesResolver = userWallet.scanResponse.cardTypesResolver
|
||||
|
||||
val promoFlow = flow { emit(promoRepository.getChangellyPromoBanner()) }
|
||||
return combine(
|
||||
flow = getTokenListUseCase(userWallet.walletId).conflate(),
|
||||
flow2 = isReadyToShowRateAppUseCase().conflate(),
|
||||
flow3 = isNeedToBackupUseCase(userWallet.walletId).conflate(),
|
||||
flow4 = shouldShowSwapPromoWalletUseCase().conflate(),
|
||||
) { maybeTokenList, isReadyToShowRating, isNeedToBackup, shouldShowPromo ->
|
||||
|
||||
val promoBanner = promoRepository.getChangellyPromoBanner()
|
||||
flow5 = promoFlow,
|
||||
) { maybeTokenList, isReadyToShowRating, isNeedToBackup, shouldShowPromo, promoBanner ->
|
||||
|
||||
readyForRateAppNotification = true
|
||||
buildList {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue