1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2731 Vault | Enhancement | Restoring either last opened space or vault (#1528)

This commit is contained in:
Evgenii Kozlov 2024-09-02 15:04:14 +02:00 committed by GitHub
parent fda05fa782
commit 22d78b0727
Signed by: github
GPG key ID: B5690EEEBB952194
15 changed files with 110 additions and 30 deletions

View file

@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.Flow
interface UserSettingsCache {
suspend fun setCurrentSpace(space: SpaceId)
suspend fun getCurrentSpace(): SpaceId?
suspend fun clearCurrentSpace()
suspend fun setDefaultObjectType(space: SpaceId, type: TypeId)
suspend fun getDefaultObjectType(space: SpaceId): TypeId?

View file

@ -62,6 +62,8 @@ class UserSettingsDataRepository(private val cache: UserSettingsCache) : UserSet
override suspend fun getCurrentSpace(): SpaceId? = cache.getCurrentSpace()
override suspend fun clearCurrentSpace() = cache.clearCurrentSpace()
override suspend fun setLastOpenedObject(id: Id, space: SpaceId) {
cache.setLastOpenedObject(id, space)
}