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,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);
}