Skip to content

Commit

Permalink
fix: add check for nil
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki committed Nov 17, 2020
1 parent c3462b9 commit e09b48a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions ios/RNSScreen.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ - (void)updateBounds
[_bridge.uiManager setSize:self.bounds.size forView:self];
}

- (void)setActivityState:(int)activityState
- (void)setActivityStateOrNil:(NSNumber *)activityStateOrNil
{
if (activityState != _activityState) {
int activityState = [activityStateOrNil intValue];
if (activityStateOrNil != nil && activityState != _activityState) {
_activityState = activityState;
[_reactSuperview markChildUpdated];
}
Expand Down Expand Up @@ -469,7 +470,7 @@ @implementation RNSScreenManager

RCT_EXPORT_MODULE()

RCT_EXPORT_VIEW_PROPERTY(activityState, int)
RCT_REMAP_VIEW_PROPERTY(activityState, activityStateOrNil, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(gestureEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(replaceAnimation, RNSScreenReplaceAnimation)
RCT_EXPORT_VIEW_PROPERTY(stackPresentation, RNSScreenStackPresentation)
Expand Down
14 changes: 7 additions & 7 deletions ios/RNSScreenContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ - (void)updateContainer
if (screenRemoved || screenAdded) {
// we disable interaction for the duration of the transition until one of the screens changes its state to "onTop"
self.userInteractionEnabled = NO;
for (RNSScreenView *screen in _reactSubviews) {
if (screen.activityState == RNSActivityStateOnTop) {
// if there is an "onTop" screen it means the transition has ended so we restore interactions
self.userInteractionEnabled = YES;
[screen notifyFinishTransitioning];
}
}

for (RNSScreenView *screen in _reactSubviews) {
if (screen.activityState == RNSActivityStateOnTop) {
// if there is an "onTop" screen it means the transition has ended so we restore interactions
self.userInteractionEnabled = YES;
[screen notifyFinishTransitioning];
}
}

Expand Down

0 comments on commit e09b48a

Please sign in to comment.