To avoid mistake, FeatureFlags does not have defaultValue set to true, and StaticFeatureFlagProvider return the default value.

This fixes #1241.
This commit is contained in:
Benoit Marty 2023-09-07 10:44:32 +02:00
parent c16c875e68
commit aacfa0d83a
3 changed files with 10 additions and 8 deletions

View file

@ -22,7 +22,7 @@ import javax.inject.Inject
/**
* This provider is used for release build.
* Change the value return by [isFeatureEnabled] to enable/disable features.
* [isFeatureEnabled] just returns the default value of the FeatureFlags.
*/
class StaticFeatureFlagProvider @Inject constructor() :
FeatureFlagProvider {
@ -31,11 +31,7 @@ class StaticFeatureFlagProvider @Inject constructor() :
override suspend fun isFeatureEnabled(feature: Feature): Boolean {
return if (feature is FeatureFlags) {
when (feature) {
FeatureFlags.LocationSharing -> true
FeatureFlags.Polls -> false
FeatureFlags.NotificationSettings -> false
}
feature.defaultValue
} else {
false
}