Skip to content

Fixes #13850 - Fixes EnterPhoneNumber Screen Loading State Issue #13898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class RegistrationActivity : BaseActivity() {
if (SignalStore.storageService.needsAccountRestore) {
Log.i(TAG, "Performing pin restore.")
startActivity(Intent(this, PinRestoreActivity::class.java))
sharedViewModel.setInProgress(false)
finish()
} else {
val isProfileNameEmpty = Recipient.self().profileName.isEmpty
Expand All @@ -83,7 +84,6 @@ class RegistrationActivity : BaseActivity() {
if (!needsProfile && !needsPin) {
sharedViewModel.completeRegistration()
}
sharedViewModel.setInProgress(false)

val startIntent = MainActivity.clearTop(this).apply {
if (needsPin) {
Expand All @@ -97,6 +97,7 @@ class RegistrationActivity : BaseActivity() {

Log.d(TAG, "Launching ${startIntent.component}")
startActivity(startIntent)
sharedViewModel.setInProgress(false)
finish()
ActivityNavigator.applyPopAnimationsToPendingTransition(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ class RegistrationViewModel : ViewModel() {
allowedToRequestCode = networkResult.body.allowedToRequestCode,
challengesRequested = Challenge.parse(networkResult.body.requestedInformation),
verified = networkResult.body.verified,
inProgress = false
)
}
},
Expand Down Expand Up @@ -486,8 +485,7 @@ class RegistrationViewModel : ViewModel() {
nextSmsTimestamp = sessionResult.nextSmsTimestamp,
nextCallTimestamp = sessionResult.nextCallTimestamp,
isAllowedToRequestCode = sessionResult.allowedToRequestCode,
challengesRequested = emptyList(),
inProgress = false
challengesRequested = emptyList()
)
}
return true
Expand All @@ -499,7 +497,6 @@ class RegistrationViewModel : ViewModel() {
it.copy(
registrationCheckpoint = RegistrationCheckpoint.CHALLENGE_RECEIVED,
challengesRequested = sessionResult.challenges,
inProgress = false
)
}
return false
Expand Down Expand Up @@ -857,8 +854,7 @@ class RegistrationViewModel : ViewModel() {

store.update {
it.copy(
registrationCheckpoint = RegistrationCheckpoint.LOCAL_REGISTRATION_COMPLETE,
inProgress = false
registrationCheckpoint = RegistrationCheckpoint.LOCAL_REGISTRATION_COMPLETE
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class RegistrationCaptchaFragment : CaptchaFragment() {
private val sharedViewModel by activityViewModels<RegistrationViewModel>()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
sharedViewModel.setInProgress(false)
sharedViewModel.addPresentedChallenge(Challenge.CAPTCHA)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class EnterCodeFragment : LoggingFragment(R.layout.fragment_registration_enter_c
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setDebugLogSubmitMultiTapView(binding.verifyHeader)
sharedViewModel.setInProgress(false)

phoneStateListener = SignalStrengthPhoneStateListener(this, PhoneStateCallback())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,10 @@ class EnterPhoneNumberFragment : LoggingFragment(R.layout.fragment_registration_

private fun moveToEnterPinScreen() {
findNavController().safeNavigate(EnterPhoneNumberFragmentDirections.actionReRegisterWithPinFragment())
sharedViewModel.setInProgress(false)
}

private fun moveToVerificationEntryScreen() {
findNavController().safeNavigate(EnterPhoneNumberFragmentDirections.actionEnterVerificationCode())
sharedViewModel.setInProgress(false)
}

private fun popBackStack() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ReRegisterWithPinFragment : LoggingFragment(R.layout.fragment_registration

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
registrationViewModel.setInProgress(false)

RegistrationViewDelegate.setDebugLogSubmitMultiTapView(binding.pinRestorePinTitle)
binding.pinRestorePinDescription.setText(R.string.RegistrationLockFragment__enter_the_pin_you_created_for_your_account)
Expand Down