Skip to content

Commit

Permalink
feat: add comment in code
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki committed Nov 19, 2020
1 parent 3c10547 commit 98efbe9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ios/RNSScreen.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ - (void)updateBounds
[_bridge.uiManager setSize:self.bounds.size forView:self];
}

// Nil will be provided when activityState is set as an animated value and we change
// it from JS to be a plain value (non animated).
// In this scenario we first trigger the code which resets it to the default,
// which is nil, and which maps to 0 meaning Inactive.
// In that case we want to ignore such update
// because soon after we get the actual, valid state passed from JS.
- (void)setActivityStateOrNil:(NSNumber *)activityStateOrNil
{
int activityState = [activityStateOrNil intValue];
Expand Down Expand Up @@ -477,6 +483,7 @@ @implementation RNSScreenManager

RCT_EXPORT_MODULE()

// we want to handle the case when activityState is nil
RCT_REMAP_VIEW_PROPERTY(activityState, activityStateOrNil, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(gestureEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(replaceAnimation, RNSScreenReplaceAnimation)
Expand Down

0 comments on commit 98efbe9

Please sign in to comment.