Fix showing alerts when modals are presented

Reviewed By: nicklockwood

Differential Revision: D2638505

fb-gh-sync-id: ebecc82baa46be4302fc8d3231f859de572eda10
This commit is contained in:
Ryan Olson 2015-11-11 09:27:16 -08:00 коммит произвёл facebook-github-bot-2
Родитель 5931089677
Коммит 51a5b60a1a
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -95,6 +95,12 @@ RCT_EXPORT_METHOD(alertWithArgs:(NSDictionary *)args
return;
}
// Walk the chain up to get the topmost modal view controller. If modals are presented,
// the root view controller's view might not be in the window hierarchy, and presenting from it will fail.
while (presentingController.presentedViewController) {
presentingController = presentingController.presentedViewController;
}
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
if ([UIAlertController class] == nil) {