adds forceLoginFallback debug feature

This commit is contained in:
ericdecanini 2022-02-23 13:02:45 +01:00
parent 924a4f8c94
commit 507ddc2d4a
3 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,11 @@ class DebugFeaturesStateFactory @Inject constructor(
label = "FTUE Use Case", label = "FTUE Use Case",
key = DebugFeatureKeys.onboardingUseCase, key = DebugFeatureKeys.onboardingUseCase,
factory = VectorFeatures::isOnboardingUseCaseEnabled factory = VectorFeatures::isOnboardingUseCaseEnabled
),
createBooleanFeature(
label = "Force login fallback",
key = DebugFeatureKeys.forceLoginFallback,
factory = VectorFeatures::isForceLoginFallbackEnabled
) )
)) ))
} }

View File

@ -51,6 +51,8 @@ class DebugVectorFeatures(
override fun isOnboardingUseCaseEnabled(): Boolean = read(DebugFeatureKeys.onboardingUseCase) ?: vectorFeatures.isOnboardingUseCaseEnabled() override fun isOnboardingUseCaseEnabled(): Boolean = read(DebugFeatureKeys.onboardingUseCase) ?: vectorFeatures.isOnboardingUseCaseEnabled()
override fun isForceLoginFallbackEnabled(): Boolean = read(DebugFeatureKeys.forceLoginFallback) ?: vectorFeatures.isForceLoginFallbackEnabled()
fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences { fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences {
if (value == null) { if (value == null) {
it.remove(key) it.remove(key)
@ -102,4 +104,5 @@ object DebugFeatureKeys {
val onboardingAlreadyHaveAnAccount = booleanPreferencesKey("onboarding-already-have-an-account") val onboardingAlreadyHaveAnAccount = booleanPreferencesKey("onboarding-already-have-an-account")
val onboardingSplashCarousel = booleanPreferencesKey("onboarding-splash-carousel") val onboardingSplashCarousel = booleanPreferencesKey("onboarding-splash-carousel")
val onboardingUseCase = booleanPreferencesKey("onbboarding-splash-carousel") val onboardingUseCase = booleanPreferencesKey("onbboarding-splash-carousel")
val forceLoginFallback = booleanPreferencesKey("force-login-fallback")
} }

View File

@ -24,6 +24,7 @@ interface VectorFeatures {
fun isOnboardingAlreadyHaveAccountSplashEnabled(): Boolean fun isOnboardingAlreadyHaveAccountSplashEnabled(): Boolean
fun isOnboardingSplashCarouselEnabled(): Boolean fun isOnboardingSplashCarouselEnabled(): Boolean
fun isOnboardingUseCaseEnabled(): Boolean fun isOnboardingUseCaseEnabled(): Boolean
fun isForceLoginFallbackEnabled(): Boolean
enum class OnboardingVariant { enum class OnboardingVariant {
LEGACY, LEGACY,
@ -37,4 +38,5 @@ class DefaultVectorFeatures : VectorFeatures {
override fun isOnboardingAlreadyHaveAccountSplashEnabled() = true override fun isOnboardingAlreadyHaveAccountSplashEnabled() = true
override fun isOnboardingSplashCarouselEnabled() = true override fun isOnboardingSplashCarouselEnabled() = true
override fun isOnboardingUseCaseEnabled() = true override fun isOnboardingUseCaseEnabled() = true
override fun isForceLoginFallbackEnabled() = false
} }