Don’t dismiss call view controller to present other view.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-08-03 10:40:45 -04:00
parent 791e270578
commit 138301975c

View file

@ -728,6 +728,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing
callOnViewAppearing:(BOOL)callOnViewAppearing
{
// TODO: Do this synchronously if we're already on the main thread.
dispatch_async(dispatch_get_main_queue(), ^{
MessagesViewController *mvc = [[MessagesViewController alloc] initWithNibName:@"MessagesViewController"
bundle:nil];
@ -736,11 +737,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
callOnViewAppearing:callOnViewAppearing];
self.lastThread = thread;
if (self.presentedViewController) {
[self.presentedViewController dismissViewControllerAnimated:YES completion:nil];
}
[self.navigationController popToRootViewControllerAnimated:YES];
[self.navigationController pushViewController:mvc animated:YES];
[self pushTopLevelViewController:mvc animateDismissal:YES animatePresentation:YES];
});
}
@ -799,6 +796,10 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
// Perform the first step.
if (self.presentedViewController) {
if ([self.presentedViewController isKindOfClass:[CallViewController class]]) {
OWSProdInfo(@"error_could_not_present_view_due_to_call");
return;
}
[self.presentedViewController dismissViewControllerAnimated:animateDismissal completion:dismissNavigationBlock];
} else {
dismissNavigationBlock();