ソースを参照

allows you to show a lightbox directly after dismissing on ios (#1466)

Nico Richard 6 年 前
コミット
4518797c38
共有1 個のファイルを変更した5 個の追加1 個の削除を含む
  1. 5
    1
      ios/RCCLightBox.m

+ 5
- 1
ios/RCCLightBox.m ファイルの表示

@@ -15,6 +15,7 @@ const NSInteger kLightBoxTag = 0x101010;
15 15
 @property (nonatomic, strong) UIView *overlayColorView;
16 16
 @property (nonatomic, strong) NSDictionary *params;
17 17
 @property (nonatomic)         BOOL yellowBoxRemoved;
18
+@property (nonatomic)         BOOL isDismissing;
18 19
 @end
19 20
 
20 21
 @implementation RCCLightBoxView
@@ -175,6 +176,8 @@ const NSInteger kLightBoxTag = 0x101010;
175 176
 
176 177
 -(void)dismissAnimated
177 178
 {
179
+    self.isDismissing = YES;
180
+    
178 181
     BOOL hasOverlayViews = (self.visualEffectView != nil || self.overlayColorView != nil);
179 182
     
180 183
     [UIView animateWithDuration:0.2 animations:^()
@@ -218,7 +221,8 @@ const NSInteger kLightBoxTag = 0x101010;
218 221
 +(void)showWithParams:(NSDictionary*)params
219 222
 {
220 223
     UIViewController *viewController = RCTPresentedViewController();
221
-    if ([viewController.view viewWithTag:kLightBoxTag] != nil)
224
+    RCCLightBoxView *previousLightBox = [viewController.view viewWithTag:kLightBoxTag];
225
+    if (previousLightBox != nil && !previousLightBox.isDismissing)
222 226
     {
223 227
         return;
224 228
     }