Updated on 2026-08-14
This commit is contained in:
parent
78996521c6
commit
ab5fac9196
41 changed files with 366 additions and 73 deletions
|
|
@ -0,0 +1,23 @@
|
|||
package com.tangem.data.wallets
|
||||
|
||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
||||
import com.tangem.datasource.local.preferences.PreferencesKeys
|
||||
import com.tangem.datasource.local.preferences.utils.getSyncOrDefault
|
||||
import com.tangem.datasource.local.preferences.utils.store
|
||||
import com.tangem.domain.wallets.repository.WalletNamesMigrationRepository
|
||||
|
||||
class DefaultWalletNamesMigrationRepository(
|
||||
private val appPreferencesStore: AppPreferencesStore,
|
||||
) : WalletNamesMigrationRepository {
|
||||
|
||||
override suspend fun isMigrationDone(): Boolean {
|
||||
return appPreferencesStore.getSyncOrDefault(
|
||||
key = PreferencesKeys.IS_WALLET_NAMES_MIGRATION_DONE_KEY,
|
||||
default = false,
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun setMigrationDone() {
|
||||
appPreferencesStore.store(PreferencesKeys.IS_WALLET_NAMES_MIGRATION_DONE_KEY, true)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
package com.tangem.data.wallets.di
|
||||
|
||||
import com.tangem.data.wallets.DefaultWalletNamesMigrationRepository
|
||||
import com.tangem.data.wallets.DefaultWalletAddressServiceRepository
|
||||
import com.tangem.data.wallets.DefaultWalletsRepository
|
||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
||||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
||||
import com.tangem.domain.wallets.repository.WalletNamesMigrationRepository
|
||||
import com.tangem.domain.wallets.repository.WalletAddressServiceRepository
|
||||
import com.tangem.domain.wallets.repository.WalletsRepository
|
||||
import dagger.Module
|
||||
|
|
@ -29,4 +31,10 @@ internal object WalletsDataModule {
|
|||
): WalletAddressServiceRepository {
|
||||
return DefaultWalletAddressServiceRepository(walletManagersFacade)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideMigrateNamesRepository(appPreferencesStore: AppPreferencesStore): WalletNamesMigrationRepository {
|
||||
return DefaultWalletNamesMigrationRepository(appPreferencesStore)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue