Fix compilation
This commit is contained in:
parent
4a24e1cd7e
commit
fd63220ee0
3 changed files with 5 additions and 6 deletions
|
|
@ -24,7 +24,6 @@ import androidx.datastore.preferences.core.edit
|
|||
import androidx.datastore.preferences.preferencesDataStore
|
||||
import io.element.android.libraries.di.ApplicationContext
|
||||
import io.element.android.libraries.featureflag.api.Feature
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.map
|
||||
import javax.inject.Inject
|
||||
|
|
@ -45,10 +44,10 @@ class PreferencesFeatureFlagProvider @Inject constructor(@ApplicationContext con
|
|||
}
|
||||
}
|
||||
|
||||
override fun isFeatureEnabled(feature: Feature): Flow<Boolean> {
|
||||
override suspend fun isFeatureEnabled(feature: Feature): Boolean {
|
||||
return store.data.map { prefs ->
|
||||
prefs[booleanPreferencesKey(feature.key)] ?: feature.defaultValue
|
||||
}
|
||||
}.first()
|
||||
}
|
||||
|
||||
override fun hasFeature(feature: Feature): Boolean {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue