Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar0-0 committed Jan 2, 2025
1 parent ba79a3e commit 517aeee
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
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

0 comments on commit 517aeee

Please sign in to comment.