Permalink
Browse files

Avoid presenting on view controller that's being dismissed

Summary:
Mitigates the issue in #10471, by not trying to present
a modal or alert view if the presenting view controller is already being dismissed.

Reviewed By: shergin

Differential Revision: D4962169

fbshipit-source-id: 593e3f21096458651d16677a3e030552f809bf02
  • Loading branch information...
javache authored and facebook-github-bot committed Apr 28, 2017
1 parent ae7edff commit 96d13b663bd9717c2cc37044208799fc39e5e8b2
Showing with 4 additions and 3 deletions.
  1. +4 −3 React/Base/RCTUtils.m
View
@@ -481,9 +481,10 @@ BOOL RCTRunningInAppExtension(void)
}
UIViewController *controller = RCTKeyWindow().rootViewController;
while (controller.presentedViewController) {
controller = controller.presentedViewController;
UIViewController *presentedController = controller.presentedViewController;
while (presentedController && ![presentedController isBeingDismissed]) {
controller = presentedController;
presentedController = controller.presentedViewController;
}
return controller;

0 comments on commit 96d13b6

Please sign in to comment.