From 138301975ce022ad9e26230fc52c927252e2ce81 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 3 Aug 2017 10:40:45 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20dismiss=20call=20view=20control?= =?UTF-8?q?ler=20to=20present=20other=20view.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit // FREEBIE --- Signal/src/ViewControllers/SignalsViewController.m | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Signal/src/ViewControllers/SignalsViewController.m b/Signal/src/ViewControllers/SignalsViewController.m index 8758a42ed..b163ff4ac 100644 --- a/Signal/src/ViewControllers/SignalsViewController.m +++ b/Signal/src/ViewControllers/SignalsViewController.m @@ -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();