Parcourir la source

Add commandType param to props which indicates if a screen is displayed using push or modal

Guy Carmeli il y a 7 ans
Parent
révision
57d016d835
1 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 12
    0
      src/deprecated/platformSpecificDeprecated.android.js

+ 12
- 0
src/deprecated/platformSpecificDeprecated.android.js Voir le fichier

@@ -80,6 +80,12 @@ function navigatorPush(navigator, params) {
80 80
   adapted = adaptNavigationParams(adapted);
81 81
   adapted.overrideBackPress = params.overrideBackPress;
82 82
   adapted.timestamp = Date.now();
83
+  if (!adapted.passProps) {
84
+    adapted.passProps = {};
85
+  }
86
+  if (!adapted.passProps.commandType) {
87
+    adapted.passProps.commandType = 'Push';
88
+  }
83 89
 
84 90
   return newPlatformSpecific.push(adapted);
85 91
 }
@@ -472,6 +478,12 @@ function showModal(params) {
472 478
   adapted = adaptNavigationParams(adapted);
473 479
   adapted.overrideBackPress = params.overrideBackPress;
474 480
   adapted.timestamp = Date.now();
481
+  if (!adapted.passProps) {
482
+    adapted.passProps = {};
483
+  }
484
+  if (!adapted.passProps.commandType) {
485
+    adapted.passProps.commandType = 'ShowModal';
486
+  }
475 487
 
476 488
   newPlatformSpecific.showModal(adapted);
477 489
 }