-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/React/Views/RCTModalHostViewManager.m b/React/Views/RCTModalHostViewManager.m | ||
index 7fab70ef636368b45ba250f6f304df5203d6f2d8..4b9f9ad7267c8f3ed04e9ab3007c193d423df91a 100644 | ||
--- a/React/Views/RCTModalHostViewManager.m | ||
+++ b/React/Views/RCTModalHostViewManager.m | ||
@@ -75,13 +75,15 @@ RCT_EXPORT_MODULE() | ||
modalHostView.onShow(nil); | ||
} | ||
}; | ||
- if (_presentationBlock) { | ||
- _presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock); | ||
- } else { | ||
- [[modalHostView reactViewController] presentViewController:viewController | ||
- animated:animated | ||
- completion:completionBlock]; | ||
- } | ||
+ dispatch_async(dispatch_get_main_queue(), ^{ | ||
+ if (self->_presentationBlock) { | ||
+ self->_presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock); | ||
+ } else { | ||
+ [[modalHostView reactViewController] presentViewController:viewController | ||
+ animated:animated | ||
+ completion:completionBlock]; | ||
+ } | ||
+ }); | ||
} | ||
|
||
- (void)dismissModalHostView:(RCTModalHostView *)modalHostView | ||
@@ -93,11 +95,13 @@ RCT_EXPORT_MODULE() | ||
[[self.bridge moduleForClass:[RCTModalManager class]] modalDismissed:modalHostView.identifier]; | ||
} | ||
}; | ||
- if (_dismissalBlock) { | ||
- _dismissalBlock([modalHostView reactViewController], viewController, animated, completionBlock); | ||
- } else { | ||
- [viewController.presentingViewController dismissViewControllerAnimated:animated completion:completionBlock]; | ||
- } | ||
+ dispatch_async(dispatch_get_main_queue(), ^{ | ||
+ if (self->_dismissalBlock) { | ||
+ self->_dismissalBlock([modalHostView reactViewController], viewController, animated, completionBlock); | ||
+ } else { | ||
+ [viewController.presentingViewController dismissViewControllerAnimated:animated completion:completionBlock]; | ||
+ } | ||
+ }); | ||
} | ||
|
||
- (RCTShadowView *)shadowView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters