formatting

This commit is contained in:
Adam Brown 2022-06-09 17:42:42 +01:00
parent f2db4be479
commit bfa50f186a
4 changed files with 9 additions and 9 deletions

View File

@ -224,7 +224,7 @@ class FtueAuthGenericTextInputFormFragment @Inject constructor() : AbstractFtueA
TextInputFormFragmentMode.SetEmail -> {
views.loginGenericTextInputFormTil.error = errorFormatter.toHumanReadable(throwable)
}
TextInputFormFragmentMode.SetMsisdn -> {
TextInputFormFragmentMode.SetMsisdn -> {
views.loginGenericTextInputFormTil.error = errorFormatter.toHumanReadable(throwable)
}
TextInputFormFragmentMode.ConfirmMsisdn -> {

View File

@ -68,9 +68,9 @@ class FtueAuthPhoneEntryFragment @Inject constructor(
val number = views.phoneEntryInput.content()
when (val result = phoneNumberParser.parseInternationalNumber(number)) {
PhoneNumberParser.Result.ErrorInvalidNumber -> views.phoneEntryInput.error = getString(R.string.login_msisdn_error_other)
PhoneNumberParser.Result.ErrorInvalidNumber -> views.phoneEntryInput.error = getString(R.string.login_msisdn_error_other)
PhoneNumberParser.Result.ErrorMissingInternationalCode -> views.phoneEntryInput.error = getString(R.string.login_msisdn_error_not_international)
is PhoneNumberParser.Result.Success -> {
is PhoneNumberParser.Result.Success -> {
val (countryCode, phoneNumber) = result
viewModel.handle(OnboardingAction.PostRegisterAction(RegisterAction.AddThreePid(RegisterThreePid.Msisdn(phoneNumber, countryCode))))
}

View File

@ -387,10 +387,10 @@ class FtueAuthVariant(
when (stage) {
is Stage.ReCaptcha -> onCaptcha(stage)
is Stage.Email -> onEmail(stage)
is Stage.Msisdn -> onMsisdn(stage)
is Stage.Terms -> onTerms(stage)
else -> Unit // Should not happen
is Stage.Email -> onEmail(stage)
is Stage.Msisdn -> onMsisdn(stage)
is Stage.Terms -> onTerms(stage)
else -> Unit // Should not happen
}
}
@ -399,7 +399,7 @@ class FtueAuthVariant(
vectorFeatures.isOnboardingCombinedRegisterEnabled() -> addRegistrationStageFragmentToBackstack(
FtueAuthPhoneEntryFragment::class.java
)
else -> addRegistrationStageFragmentToBackstack(
else -> addRegistrationStageFragmentToBackstack(
FtueAuthGenericTextInputFormFragment::class.java,
FtueAuthGenericTextInputFormFragmentArgument(TextInputFormFragmentMode.SetMsisdn, stage.mandatory),
)

View File

@ -27,7 +27,7 @@ class PhoneNumberParser @Inject constructor(
fun parseInternationalNumber(rawPhoneNumber: String): Result {
return when {
rawPhoneNumber.doesNotStartWith("+") -> Result.ErrorMissingInternationalCode
else -> parseNumber(rawPhoneNumber)
else -> parseNumber(rawPhoneNumber)
}
}