|
|
@ -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:^{
|
|
|
|
|
|
|
|
[alertController
|
|
|
|
|
|
|
|
dismissViewControllerAnimated:NO
|
|
|
|
|
|
|
|
completion:^{
|
|
|
|
[OWSAlerts
|
|
|
|
[OWSAlerts
|
|
|
|
showAlertWithTitle:NSLocalizedString(@"ALERT_ERROR_TITLE", @"")
|
|
|
|
showAlertWithTitle:NSLocalizedString(
|
|
|
|
message:NSLocalizedString(@"PROFILE_VIEW_ERROR_UPDATE_FAILED",
|
|
|
|
@"ALERT_ERROR_TITLE", @"")
|
|
|
|
@"Error message shown when a profile update fails.")];
|
|
|
|
message:
|
|
|
|
|
|
|
|
NSLocalizedString(
|
|
|
|
|
|
|
|
@"PROFILE_VIEW_ERROR_UPDATE_FAILED",
|
|
|
|
|
|
|
|
@"Error message shown when a "
|
|
|
|
|
|
|
|
@"profile update fails.")];
|
|
|
|
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
|
|
|