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

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 791e270578
commit 138301975c

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

Loading…
Cancel
Save