mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
UnifiedPush WIP
This commit is contained in:
committed by
Benoit Marty
parent
8f565edb0a
commit
287fca5438
+5
-5
@@ -33,16 +33,16 @@ class UserPushStoreDataStore(
|
||||
userId: String,
|
||||
) : UserPushStore {
|
||||
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "push_store_$userId")
|
||||
private val notificationMethod = stringPreferencesKey("notificationMethod")
|
||||
private val pushProviderName = stringPreferencesKey("pushProviderName")
|
||||
private val currentPushKey = stringPreferencesKey("currentPushKey")
|
||||
|
||||
override suspend fun getNotificationMethod(): String? {
|
||||
return context.dataStore.data.first()[notificationMethod]
|
||||
override suspend fun getPushProviderName(): String? {
|
||||
return context.dataStore.data.first()[pushProviderName]
|
||||
}
|
||||
|
||||
override suspend fun setNotificationMethod(value: String) {
|
||||
override suspend fun setPushProviderName(value: String) {
|
||||
context.dataStore.edit {
|
||||
it[notificationMethod] = value
|
||||
it[pushProviderName] = value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user