Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 3ecd415b84
commit ddd8c9ff5f

@ -225,27 +225,37 @@ NS_ASSUME_NONNULL_BEGIN
__weak ProfileViewController *weakSelf = self; __weak ProfileViewController *weakSelf = self;
// Show an activity indicator to block the UI during the profile upload. // Show an activity indicator to block the UI during the profile upload.
UIAlertController *alertController = UIAlertController *alertController = [UIAlertController
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"PROFILE_VIEW_SAVING", alertControllerWithTitle:NSLocalizedString(@"PROFILE_VIEW_SAVING",
@"Indicates that the user's profile view is being saved.") @"Alert title that indicates the user's profile view is being saved.")
message:nil message:nil
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:alertController [self presentViewController:alertController
animated:YES animated:YES
completion:^{ completion:^{
[alertController dismissViewControllerAnimated:NO completion:nil];
[OWSProfileManager.sharedManager updateLocalProfileName:[self normalizedProfileName] [OWSProfileManager.sharedManager updateLocalProfileName:[self normalizedProfileName]
avatarImage:self.avatar avatarImage:self.avatar
success:^{ success:^{
[weakSelf.navigationController popViewControllerAnimated:YES]; [alertController dismissViewControllerAnimated:NO
completion:^{
[weakSelf.navigationController
popViewControllerAnimated:YES];
}];
} }
failure:^{ failure:^{
[OWSAlerts [alertController
showAlertWithTitle:NSLocalizedString(@"ALERT_ERROR_TITLE", @"") dismissViewControllerAnimated:NO
message:NSLocalizedString(@"PROFILE_VIEW_ERROR_UPDATE_FAILED", completion:^{
@"Error message shown when a profile update fails.")]; [OWSAlerts
showAlertWithTitle:NSLocalizedString(
@"ALERT_ERROR_TITLE", @"")
message:
NSLocalizedString(
@"PROFILE_VIEW_ERROR_UPDATE_FAILED",
@"Error message shown when a "
@"profile update fails.")];
}];
}]; }];
}]; }];
} }

@ -1081,7 +1081,7 @@
/* Label for the profile name field of the profile view. */ /* Label for the profile name field of the profile view. */
"PROFILE_VIEW_NAME_SECTION_HEADER" = "Profile Name"; "PROFILE_VIEW_NAME_SECTION_HEADER" = "Profile Name";
/* Indicates that the user's profile view is being saved. */ /* Alert title that indicates the user's profile view is being saved. */
"PROFILE_VIEW_SAVING" = "Saving..."; "PROFILE_VIEW_SAVING" = "Saving...";
/* Title for the profile view. */ /* Title for the profile view. */

Loading…
Cancel
Save