Преглед на файлове

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