mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-09 16:48:54 +01:00
using md5 hash of the userId to normalise the usage as a key
This commit is contained in:
parent
bc373917b5
commit
cbdeb54fdb
@ -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…
x
Reference in New Issue
Block a user