Updated on 2026-08-14
This commit is contained in:
parent
f75a69abfe
commit
4d7ae277a4
14 changed files with 498 additions and 10 deletions
|
|
@ -34,6 +34,11 @@ internal class DefaultETagsStore(
|
|||
appPreferencesStore.store(key = key, value = value)
|
||||
}
|
||||
|
||||
override suspend fun clear(userWalletId: UserWalletId, key: ETagsStore.Key) {
|
||||
val key = getAccountsETagKey(userWalletId = userWalletId, key = key)
|
||||
appPreferencesStore.editData { it.remove(key) }
|
||||
}
|
||||
|
||||
private fun getAccountsETagKey(userWalletId: UserWalletId, key: ETagsStore.Key): Preferences.Key<String> {
|
||||
return stringPreferencesKey(name = "etag_${key}_${userWalletId.stringValue}")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,14 @@ interface ETagsStore {
|
|||
*/
|
||||
suspend fun store(userWalletId: UserWalletId, key: Key, value: String)
|
||||
|
||||
/**
|
||||
* Clears the stored ETag value for the specified wallet and key
|
||||
*
|
||||
* @param userWalletId identifier of the user wallet
|
||||
* @param key the key for which to get the ETag value
|
||||
*/
|
||||
suspend fun clear(userWalletId: UserWalletId, key: Key)
|
||||
|
||||
/** Enumeration of possible keys for storing ETag values */
|
||||
enum class Key {
|
||||
WalletAccounts,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue