diff --git a/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/RegistrationCompleteFragment.java b/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/RegistrationCompleteFragment.java index f6fee31c2..bd7c87d05 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/RegistrationCompleteFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/RegistrationCompleteFragment.java @@ -50,25 +50,17 @@ public final class RegistrationCompleteFragment extends LoggingFragment { if (SignalStore.storageService().needsAccountRestore()) { Log.i(TAG, "Performing pin restore"); activity.startActivity(new Intent(activity, PinRestoreActivity.class)); - } else if (!viewModel.isReregister()) { + } else { + boolean needsPin = !SignalStore.kbsValues().hasPin() && !viewModel.isReregister(); boolean needsProfile = Recipient.self().getProfileName().isEmpty() || !AvatarHelper.hasAvatar(activity, Recipient.self().getId()); - boolean needsPin = !SignalStore.kbsValues().hasPin(); Log.i(TAG, "Pin restore flow not required." + - " profile name: " + Recipient.self().getProfileName().isEmpty() + + " profile name: " + Recipient.self().getProfileName().isEmpty() + " profile avatar: " + !AvatarHelper.hasAvatar(activity, Recipient.self().getId()) + - " needsPin:" + needsPin); + " needsPin:" + needsPin); Intent startIntent = MainActivity.clearTop(activity); - if (needsPin) { - startIntent = chainIntents(CreateKbsPinActivity.getIntentForPinCreate(requireContext()), startIntent); - } - - if (needsProfile) { - startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent); - } - if (!needsProfile && !needsPin) { ApplicationDependencies.getJobManager() .startChain(new ProfileUploadJob()) @@ -76,11 +68,18 @@ public final class RegistrationCompleteFragment extends LoggingFragment { .enqueue(); RegistrationUtil.maybeMarkRegistrationComplete(requireContext()); + } else { + if (needsPin) { + startIntent = chainIntents(CreateKbsPinActivity.getIntentForPinCreate(requireContext()), startIntent); + } + + if (needsProfile) { + startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent); + } } activity.startActivity(startIntent); } - activity.finish(); ActivityNavigator.applyPopAnimationsToPendingTransition(activity); }