Browse Source

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

Nico Richard 6 years ago
parent
commit
4518797c38
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      ios/RCCLightBox.m

+ 5
- 1
ios/RCCLightBox.m View File

15
 @property (nonatomic, strong) UIView *overlayColorView;
15
 @property (nonatomic, strong) UIView *overlayColorView;
16
 @property (nonatomic, strong) NSDictionary *params;
16
 @property (nonatomic, strong) NSDictionary *params;
17
 @property (nonatomic)         BOOL yellowBoxRemoved;
17
 @property (nonatomic)         BOOL yellowBoxRemoved;
18
+@property (nonatomic)         BOOL isDismissing;
18
 @end
19
 @end
19
 
20
 
20
 @implementation RCCLightBoxView
21
 @implementation RCCLightBoxView
175
 
176
 
176
 -(void)dismissAnimated
177
 -(void)dismissAnimated
177
 {
178
 {
179
+    self.isDismissing = YES;
180
+    
178
     BOOL hasOverlayViews = (self.visualEffectView != nil || self.overlayColorView != nil);
181
     BOOL hasOverlayViews = (self.visualEffectView != nil || self.overlayColorView != nil);
179
     
182
     
180
     [UIView animateWithDuration:0.2 animations:^()
183
     [UIView animateWithDuration:0.2 animations:^()
218
 +(void)showWithParams:(NSDictionary*)params
221
 +(void)showWithParams:(NSDictionary*)params
219
 {
222
 {
220
     UIViewController *viewController = RCTPresentedViewController();
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
         return;
227
         return;
224
     }
228
     }