瀏覽代碼

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

Ran 7 年之前
父節點
當前提交
317c7773e3
共有 3 個文件被更改,包括 8 次插入4 次删除
  1. 4
    0
      ios/RCCManagerModule.m
  2. 2
    2
      src/deprecated/controllers/index.js
  3. 2
    2
      src/deprecated/platformSpecificDeprecated.ios.js

+ 4
- 0
ios/RCCManagerModule.m 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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) {