Skip to content

Commit 8c35175

Browse files
committed
Fixes e2e
1 parent d95759f commit 8c35175

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

lib/ios/RNNCommandsHandler.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ - (void)setStackRoot:(NSString*)componentId children:(NSArray*)children completi
155155
[self assertReady];
156156

157157
NSArray<RNNLayoutProtocol> *childViewControllers = [_controllerFactory createChildrenLayout:children];
158+
for (UIViewController<RNNLayoutProtocol>* viewController in childViewControllers) {
159+
[viewController renderTreeAndWait:NO perform:nil];
160+
}
158161
RNNNavigationOptions* options = [childViewControllers.lastObject getCurrentChild].resolveOptions;
159162
UIViewController *fromVC = [_store findComponentForId:componentId];
160163
__weak typeof(RNNEventEmitter*) weakEventEmitter = _eventEmitter;

lib/ios/RNNRootViewController.m

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,27 @@ - (void)viewDidDisappear:(BOOL)animated {
8989
}
9090

9191
- (void)renderTreeAndWait:(BOOL)wait perform:(RNNReactViewReadyCompletionBlock)readyBlock {
92-
if (!wait || self.isExternalViewController) {
92+
if (self.isExternalViewController && readyBlock) {
9393
readyBlock();
94-
readyBlock = nil;
94+
return;
9595
}
96-
[_presenter renderComponents:self.resolveOptions perform:^{
97-
if (self.creator) {
98-
UIView* reactView = [_creator createRootView:self.layoutInfo.name rootViewId:self.layoutInfo.componentId reactViewReadyBlock:readyBlock];
99-
reactView.backgroundColor = [UIColor clearColor];
100-
reactView.frame = self.view.bounds;
101-
[self.view addSubview:reactView];
102-
} else if (readyBlock) {
103-
readyBlock();
104-
}
96+
97+
__block RNNReactViewReadyCompletionBlock readyBlockCopy = readyBlock;
98+
UIView* reactView = [_creator createRootView:self.layoutInfo.name rootViewId:self.layoutInfo.componentId reactViewReadyBlock:^{
99+
[_presenter renderComponents:self.resolveOptions perform:^{
100+
if (readyBlockCopy) {
101+
readyBlockCopy();
102+
readyBlockCopy = nil;
103+
}
104+
}];
105105
}];
106+
reactView.backgroundColor = [UIColor clearColor];
107+
self.view = reactView;
108+
109+
if (!wait && readyBlock) {
110+
readyBlockCopy();
111+
readyBlockCopy = nil;
112+
}
106113
}
107114

108115
- (UIViewController *)getCurrentChild {

lib/ios/RNNViewControllerPresenter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavig
154154
rootView.passThroughTouches = !newOptions.overlay.interceptTouchOutside.get;
155155
}
156156

157+
[self setTitleViewWithSubtitle:newOptions];
158+
157159
if (newOptions.topBar.title.component.name.hasValue) {
158160
[self setCustomNavigationTitleView:newOptions perform:nil];
159161
}
160-
161-
[self setTitleViewWithSubtitle:newOptions];
162162
}
163163

164164
- (void)renderComponents:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {

0 commit comments

Comments
 (0)