Updated on 2026-08-14
This commit is contained in:
parent
d82dbdd1e6
commit
075db99e51
13 changed files with 32 additions and 8 deletions
|
|
@ -25,6 +25,7 @@ dependencies {
|
|||
implementation(projects.domain.express.models)
|
||||
implementation(projects.domain.express)
|
||||
implementation(projects.domain.wallets.models)
|
||||
implementation(projects.domain.txhistory)
|
||||
api(projects.domain.models)
|
||||
|
||||
/** Other */
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.tangem.domain.express.ExpressRepository
|
|||
import com.tangem.domain.express.models.ExpressProvider
|
||||
import com.tangem.domain.express.models.ExpressProviderType
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.extensions.filterIf
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
|
@ -21,6 +22,7 @@ internal class DefaultExpressRepository(
|
|||
private val expressHistoryDao: ExpressHistoryDao,
|
||||
private val appPreferencesStore: AppPreferencesStore,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
private val txHistoryFeatureToggles: TxHistoryFeatureToggles,
|
||||
) : ExpressRepository {
|
||||
|
||||
override suspend fun getProviders(
|
||||
|
|
@ -37,7 +39,9 @@ internal class DefaultExpressRepository(
|
|||
),
|
||||
).getOrThrow()
|
||||
|
||||
expressHistoryDao.upsertProviders(providers.map { it.toEntity() })
|
||||
if (txHistoryFeatureToggles.isNewTxHistoryEnabled) {
|
||||
expressHistoryDao.upsertProviders(providers.map { it.toEntity() })
|
||||
}
|
||||
|
||||
providers.map(ExpressProviderConverter()::convert)
|
||||
.filterIf(filterProviderTypes.isNotEmpty()) { it.type in filterProviderTypes }
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.tangem.datasource.local.txhistory.db.dao.ExpressHistoryDao
|
|||
import com.tangem.domain.express.ExpressErrorResolver
|
||||
import com.tangem.domain.express.ExpressRepository
|
||||
import com.tangem.domain.express.ExpressServiceFetcher
|
||||
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
|
@ -40,12 +41,14 @@ internal object ExpressDataModule {
|
|||
expressHistoryDao: ExpressHistoryDao,
|
||||
appPreferencesStore: AppPreferencesStore,
|
||||
dispatchers: CoroutineDispatcherProvider,
|
||||
txHistoryFeatureToggles: TxHistoryFeatureToggles,
|
||||
): ExpressRepository {
|
||||
return DefaultExpressRepository(
|
||||
tangemExpressApi = tangemExpressApi,
|
||||
expressHistoryDao = expressHistoryDao,
|
||||
appPreferencesStore = appPreferencesStore,
|
||||
dispatchers = dispatchers,
|
||||
txHistoryFeatureToggles = txHistoryFeatureToggles,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue