Skip to content

Commit

Permalink
Revert updateContainer threading changes from #351.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagiera committed Feb 20, 2020
1 parent 748cdc6 commit 9bf2edd
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions ios/RNSScreenStack.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,13 @@ - (void)didMoveToWindow
// when stack is added to a window we try to update push and modal view controllers. It is
// because modal operations are blocked by UIKit when parent VC is not mounted, so we need
// to redo them when the stack is attached.
[self updateContainerAfterBatch];
[self updateContainer];
} else {
[_controller removeFromParentViewController];
[_controller didMoveToParentViewController:nil];
}
}

- (void)updateContainerAfterBatch
{
if ([_manager.bridge isBatchActive]) {
[_manager.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
dispatch_async(dispatch_get_main_queue(), ^{
[self updateContainer];
});
}];
} else {
[self updateContainer];
}
}

- (void)setModalViewControllers:(NSArray<UIViewController *> *)controllers
{
// when there is no change we return immediately. This check is important because sometime we may
Expand Down Expand Up @@ -250,7 +237,7 @@ - (void)setModalViewControllers:(NSArray<UIViewController *> *)controllers
// flag in order to perform updates at a later point. Here we are done with all modals
// transitions and check this flag again. If it was set, we reset the flag and execute updates.
weakSelf.scheduleModalsUpdate = NO;
[weakSelf updateContainerAfterBatch];
[weakSelf updateContainer];
}
};

Expand Down

0 comments on commit 9bf2edd

Please sign in to comment.