Browse Source

notify when modal dismissed (after animation if exists) (#736)

Ran 7 years ago
parent
commit
317c7773e3

+ 4
- 0
ios/RCCManagerModule.m View File

@@ -325,6 +325,10 @@ dismissController:(NSString*)animationType resolver:(RCTPromiseResolveBlock)reso
325 325
         [vc dismissViewControllerAnimated:![animationType isEqualToString:@"none"]
326 326
                                completion:^(){ resolve(nil); }];
327 327
     }
328
+    else
329
+    {
330
+      resolve(nil);
331
+    }
328 332
 }
329 333
 
330 334
 RCT_EXPORT_METHOD(

+ 2
- 2
src/deprecated/controllers/index.js View File

@@ -258,8 +258,8 @@ var Controllers = {
258 258
       _validateDrawerProps(layout);
259 259
       RCCManager.showController(layout, animationType, passProps);
260 260
     },
261
-    dismissController: function(animationType = 'slide-down') {
262
-      RCCManager.dismissController(animationType);
261
+    dismissController: async function(animationType = 'slide-down') {
262
+      return await RCCManager.dismissController(animationType);
263 263
     },
264 264
     dismissAllControllers: function(animationType = 'slide-down') {
265 265
       RCCManager.dismissAllControllers(animationType);

+ 2
- 2
src/deprecated/platformSpecificDeprecated.ios.js View File

@@ -442,8 +442,8 @@ function showModal(params) {
442 442
   Modal.showController(controllerID, params.animationType);
443 443
 }
444 444
 
445
-function dismissModal(params) {
446
-  Modal.dismissController(params.animationType);
445
+async function dismissModal(params) {
446
+  return await Modal.dismissController(params.animationType);
447 447
 }
448 448
 
449 449
 function dismissAllModals(params) {