mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 10:25:51 +03:00
using md5 hash of the userId to normalise the usage as a key
This commit is contained in:
parent
bc373917b5
commit
cbdeb54fdb
1 changed files with 2 additions and 1 deletions
|
@ -24,6 +24,7 @@ import androidx.datastore.preferences.core.stringPreferencesKey
|
|||
import androidx.datastore.preferences.preferencesDataStore
|
||||
import im.vector.app.features.onboarding.FtueUseCase
|
||||
import kotlinx.coroutines.flow.first
|
||||
import org.matrix.android.sdk.internal.util.md5
|
||||
|
||||
/**
|
||||
* Local storage for:
|
||||
|
@ -34,7 +35,7 @@ class VectorSessionStore constructor(
|
|||
myUserId: String
|
||||
) {
|
||||
|
||||
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "vector_session_store_$myUserId")
|
||||
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "vector_session_store_${myUserId.md5()}")
|
||||
private val useCaseKey = stringPreferencesKey("use_case")
|
||||
|
||||
suspend fun readUseCase() = context.dataStore.data.first().let { preferences ->
|
||||
|
|
Loading…
Reference in a new issue