mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 19:58:57 +03:00
adds feature flag usage to registration flow result
This commit is contained in:
parent
507ddc2d4a
commit
713248805c
1 changed files with 7 additions and 2 deletions
|
@ -123,8 +123,7 @@ class FtueAuthVariant(
|
|||
private fun handleOnboardingViewEvents(viewEvents: OnboardingViewEvents) {
|
||||
when (viewEvents) {
|
||||
is OnboardingViewEvents.RegistrationFlowResult -> {
|
||||
// Check that all flows are supported by the application
|
||||
if (viewEvents.flowResult.missingStages.any { !it.isSupported() }) {
|
||||
if (registrationShouldFallback(viewEvents)) {
|
||||
// Display a popup to propose use web fallback
|
||||
onRegistrationStageNotSupported()
|
||||
} else {
|
||||
|
@ -223,6 +222,12 @@ class FtueAuthVariant(
|
|||
}.exhaustive
|
||||
}
|
||||
|
||||
private fun registrationShouldFallback(registrationFlowResult: OnboardingViewEvents.RegistrationFlowResult) =
|
||||
vectorFeatures.isForceLoginFallbackEnabled() || registrationFlowResult.containsUnsupportedRegistrationFlow()
|
||||
|
||||
private fun OnboardingViewEvents.RegistrationFlowResult.containsUnsupportedRegistrationFlow() =
|
||||
flowResult.missingStages.any { !it.isSupported() }
|
||||
|
||||
private fun updateWithState(viewState: OnboardingViewState) {
|
||||
if (viewState.isUserLogged()) {
|
||||
val intent = HomeActivity.newIntent(
|
||||
|
|
Loading…
Add table
Reference in a new issue