Make 2FA registration screen look like the rest of registration

// FREEBIE
This commit is contained in:
Michael Kirk 2018-03-05 11:27:56 -05:00
parent 471a194764
commit 60a1cc5682
3 changed files with 16 additions and 4 deletions

View File

@ -54,6 +54,15 @@ NS_ASSUME_NONNULL_BEGIN
{
[super viewDidLoad];
// The navigation bar is hidden in the registration workflow.
if (self.navigationController.navigationBarHidden) {
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
self.navigationItem.hidesBackButton = YES;
self.title = NSLocalizedString(@"REGISTRATION_ENTER_LOCK_PIN_NAV_TITLE",
@"Navigation title shown when user is re-registering after having enabled registration lock");
self.view.backgroundColor = UIColor.whiteColor;
PinEntryView *entryView = [PinEntryView new];
@ -65,7 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
@"REGISTER_2FA_INSTRUCTIONS", @"Instructions to enter the 'two-factor auth pin' in the 2FA registration view.");
// Layout
[entryView autoPinEdgesToSuperviewMargins];
}

View File

@ -1420,6 +1420,9 @@
/* Label for the country code field */
"REGISTRATION_DEFAULT_COUNTRY_NAME" = "Country Code";
/* Navigation title shown when user is re-registering after having enabled registration lock */
"REGISTRATION_ENTER_LOCK_PIN_NAV_TITLE" = "Registration Lock";
/* Placeholder text for the phone number textfield */
"REGISTRATION_ENTERNUMBER_DEFAULT_TEXT" = "Enter Number";

View File

@ -408,10 +408,11 @@ NSString *const TSAccountManager_ServerSignalingKey = @"TSStorageServerSignaling
break;
}
case 423: {
NSString *localizedMessage = NSLocalizedString(@"REGISTRATION_VERIFICATION_FAILED_WRONG_PIN",
"Error message indicating that registration failed due to a missing or incorrect 2FA PIN.");
DDLogError(@"%@ 2FA PIN required: %ld", self.logTag, error.code);
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeRegistrationMissing2FAPIN,
NSLocalizedString(@"REGISTRATION_VERIFICATION_FAILED_WRONG_PIN",
"Error message indicating that registration failed due to a missing or incorrect 2FA PIN."));
NSError *error
= OWSErrorWithCodeDescription(OWSErrorCodeRegistrationMissing2FAPIN, localizedMessage);
failureBlock(error);
break;
}