Avoid presenting on view controller that's being dismissed
Summary: Mitigates the issue in https://github.com/facebook/react-native/issues/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
This commit is contained in:
parent
ae7edff707
commit
96d13b663b
|
@ -481,9 +481,10 @@ UIViewController *__nullable RCTPresentedViewController(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;
|
||||
|
|
Loading…
Reference in New Issue