Updated on 2026-08-14
This commit is contained in:
parent
7be6ce9dba
commit
0cd80d7c50
13 changed files with 109 additions and 5 deletions
|
|
@ -47,5 +47,10 @@ internal class DefaultNFTPersistenceStore(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun clear() {
|
||||
collectionsPersistenceStore.updateData { emptyList() }
|
||||
pricesPersistenceStore.updateData { emptyList() }
|
||||
}
|
||||
|
||||
private fun NFTCollection.getAsset(assetId: NFTAsset.Identifier) = assets.firstOrNull { it.identifier == assetId }
|
||||
}
|
||||
|
|
@ -71,6 +71,16 @@ internal class DefaultNFTRuntimeStore(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun clear() {
|
||||
collectionsRuntimeStore.store(
|
||||
NFTCollections(
|
||||
network = network,
|
||||
content = NFTCollections.Content.Collections(null, StatusSource.ONLY_CACHE),
|
||||
),
|
||||
)
|
||||
pricesRuntimeStore.store(emptyMap())
|
||||
}
|
||||
|
||||
private fun NFTCollections.getCollection(collectionId: NFTCollection.Identifier): NFTCollection? =
|
||||
(content as? NFTCollections.Content.Collections)
|
||||
?.collections
|
||||
|
|
|
|||
|
|
@ -18,4 +18,6 @@ interface NFTPersistenceStore {
|
|||
suspend fun saveCollections(collections: List<NFTCollection>)
|
||||
|
||||
suspend fun saveSalePrice(assetId: NFTAsset.Identifier, salePrice: NFTAsset.SalePrice)
|
||||
|
||||
suspend fun clear()
|
||||
}
|
||||
|
|
@ -23,4 +23,6 @@ interface NFTRuntimeStore {
|
|||
suspend fun saveCollections(collections: NFTCollections)
|
||||
|
||||
suspend fun saveSalePrice(salePrice: NFTSalePrice)
|
||||
|
||||
suspend fun clear()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue