Updated on 2026-08-14

This commit is contained in:
Tangem 2025-02-24 00:58:45 +05:00
parent effe637f9f
commit c5d78b2040
11 changed files with 156 additions and 0 deletions

View file

@ -202,4 +202,24 @@ internal class DefaultWalletsRepository(
}
}
}
override fun nftEnabledStatus(userWalletId: UserWalletId): Flow<Boolean> {
return appPreferencesStore
.get(key = PreferencesKeys.WALLETS_WITH_NFT_ENABLED_KEY, default = emptySet())
.map { it.contains(userWalletId.stringValue) }
}
override suspend fun enableNFT(userWalletId: UserWalletId) {
appPreferencesStore.editData {
val added = it[PreferencesKeys.WALLETS_WITH_NFT_ENABLED_KEY].orEmpty()
it[PreferencesKeys.WALLETS_WITH_NFT_ENABLED_KEY] = added + userWalletId.stringValue
}
}
override suspend fun disableNFT(userWalletId: UserWalletId) {
appPreferencesStore.editData {
val added = it[PreferencesKeys.WALLETS_WITH_NFT_ENABLED_KEY].orEmpty()
it[PreferencesKeys.WALLETS_WITH_NFT_ENABLED_KEY] = added - userWalletId.stringValue
}
}
}