Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-27 12:26:54 +02:00
parent a8864541bc
commit 21be815a03
12 changed files with 97 additions and 1 deletions

View file

@ -54,6 +54,11 @@ internal class DefaultPromoRepository(
PromoId.VisaPresale -> {
val isActive = getVisaPromoBanner()?.isActive ?: false
isActive && shouldShow
}
PromoId.BlackFriday -> {
val isActive = getBlackFridayPromoBanner()?.isActive ?: false
isActive && shouldShow
}
}
@ -65,6 +70,7 @@ internal class DefaultPromoRepository(
PromoId.Referral -> flowOf(false)
PromoId.Sepa -> flowOf(false)
PromoId.VisaPresale -> flowOf(false)
PromoId.BlackFriday -> flowOf(false)
}
}
@ -148,9 +154,18 @@ internal class DefaultPromoRepository(
}.getOrNull()
}
private suspend fun getBlackFridayPromoBanner(): PromoBanner? {
return runCatching(dispatchers.io) {
promoBannerConverter.convert(
tangemApi.getPromoBanner(BLACK_FRIDAY_NAME).getOrThrow(),
)
}.getOrNull()
}
private companion object {
const val SEPA_NAME = "sepa"
const val VISA_NAME = "visa-waitlist"
const val BLACK_FRIDAY_NAME = "black-friday"
const val STORIES_LOAD_DELAY = 1000L
}
}