Fix PR remarks

This commit is contained in:
ismailgulek
2022-05-30 19:56:23 +03:00
parent 18a8bf53a5
commit 11d743a03e
12 changed files with 119 additions and 82 deletions
@@ -63,18 +63,17 @@ struct AuthenticationState {
AuthenticationHomeserverViewData(address: displayableAddress,
isMatrixDotOrg: isMatrixDotOrg,
showLoginForm: preferredLoginMode.supportsPasswordFlow,
showRegistrationForm: registrationFlow != nil,
showRegistrationForm: registrationFlow != nil && !needsRegistrationFallback,
ssoIdentityProviders: preferredLoginMode.ssoIdentityProviders ?? [])
}
/// Needs authentication fallback for login or registration
var needsFallback: Bool {
switch preferredLoginMode {
case .unsupported:
return true
default:
break
}
/// Needs authentication fallback for login
var needsLoginFallback: Bool {
return preferredLoginMode.isUnsupported
}
/// Needs authentication fallback for registration
var needsRegistrationFallback: Bool {
guard let flow = registrationFlow else {
return false
}