Ask for profile name on re-register if none present for number.

main
Nicholas 2023-02-27 09:16:12 -05:00 zatwierdzone przez Nicholas Tinsley
rodzic 6922886395
commit 4990243a91
1 zmienionych plików z 12 dodań i 13 usunięć

Wyświetl plik

@ -50,9 +50,9 @@ public final class RegistrationCompleteFragment extends LoggingFragment {
if (SignalStore.storageService().needsAccountRestore()) { if (SignalStore.storageService().needsAccountRestore()) {
Log.i(TAG, "Performing pin restore"); Log.i(TAG, "Performing pin restore");
activity.startActivity(new Intent(activity, PinRestoreActivity.class)); 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 needsProfile = Recipient.self().getProfileName().isEmpty() || !AvatarHelper.hasAvatar(activity, Recipient.self().getId());
boolean needsPin = !SignalStore.kbsValues().hasPin();
Log.i(TAG, "Pin restore flow not required." + Log.i(TAG, "Pin restore flow not required." +
" profile name: " + Recipient.self().getProfileName().isEmpty() + " profile name: " + Recipient.self().getProfileName().isEmpty() +
@ -61,14 +61,6 @@ public final class RegistrationCompleteFragment extends LoggingFragment {
Intent startIntent = MainActivity.clearTop(activity); Intent startIntent = MainActivity.clearTop(activity);
if (needsPin) {
startIntent = chainIntents(CreateKbsPinActivity.getIntentForPinCreate(requireContext()), startIntent);
}
if (needsProfile) {
startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent);
}
if (!needsProfile && !needsPin) { if (!needsProfile && !needsPin) {
ApplicationDependencies.getJobManager() ApplicationDependencies.getJobManager()
.startChain(new ProfileUploadJob()) .startChain(new ProfileUploadJob())
@ -76,11 +68,18 @@ public final class RegistrationCompleteFragment extends LoggingFragment {
.enqueue(); .enqueue();
RegistrationUtil.maybeMarkRegistrationComplete(requireContext()); RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
} else {
if (needsPin) {
startIntent = chainIntents(CreateKbsPinActivity.getIntentForPinCreate(requireContext()), startIntent);
}
if (needsProfile) {
startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent);
}
} }
activity.startActivity(startIntent); activity.startActivity(startIntent);
} }
activity.finish(); activity.finish();
ActivityNavigator.applyPopAnimationsToPendingTransition(activity); ActivityNavigator.applyPopAnimationsToPendingTransition(activity);
} }