Updated on 2026-08-14
This commit is contained in:
parent
391e0562cc
commit
12cebc413d
17 changed files with 686 additions and 7 deletions
|
|
@ -27,13 +27,7 @@ import com.tangem.domain.models.wallet.UserWalletId
|
|||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.coroutines.withContext
|
||||
|
|
@ -86,6 +80,14 @@ internal class DefaultAddressBookRepository(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun getContactsSync(userWalletId: UserWalletId): List<Contact> {
|
||||
return withContext(dispatchers.io) {
|
||||
val blob = blobStore.getBlobSync(userWalletId) ?: return@withContext emptyList()
|
||||
val userWallet = findUserWallet(blob.walletId) ?: return@withContext emptyList()
|
||||
decryptContacts(blob, userWallet)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getContact(userWalletId: UserWalletId, name: String): Contact? =
|
||||
withContext(dispatchers.default) {
|
||||
val blob = blobStore.getBlobSync(userWalletId) ?: return@withContext null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue