Updated on 2026-08-14
This commit is contained in:
parent
ba572cf71f
commit
77683181c7
20 changed files with 189 additions and 145 deletions
|
|
@ -1,8 +0,0 @@
|
|||
package com.tangem.feature.referral.domain
|
||||
|
||||
interface MobileWalletPromoRepository {
|
||||
|
||||
suspend fun shouldShowMobileWalletPromo(): Boolean
|
||||
|
||||
suspend fun setShouldShowMobileWalletPromo(shouldShowPromo: Boolean)
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.tangem.feature.referral.domain
|
||||
|
||||
import arrow.core.Either
|
||||
import com.tangem.domain.common.wallets.UserWalletsListRepository
|
||||
import javax.inject.Inject
|
||||
|
||||
class SetShouldShowMobileWalletPromoUseCase @Inject constructor(
|
||||
private val mobileWalletPromoRepository: MobileWalletPromoRepository,
|
||||
private val userWalletsListRepository: UserWalletsListRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(shouldShowPromo: Boolean): Either<Throwable, Unit> = Either.catch {
|
||||
val wallets = userWalletsListRepository.userWallets.value
|
||||
if (wallets.isNullOrEmpty()) {
|
||||
mobileWalletPromoRepository.setShouldShowMobileWalletPromo(shouldShowPromo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.tangem.feature.referral.domain
|
||||
|
||||
import javax.inject.Inject
|
||||
|
||||
class ShouldShowMobileWalletPromoUseCase @Inject constructor(
|
||||
private val mobileWalletPromoRepository: MobileWalletPromoRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(): Boolean {
|
||||
return mobileWalletPromoRepository.shouldShowMobileWalletPromo()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue