Skip to content

Commit

Permalink
fix(ios): Fine-tune callback timing to stay compatible with hippy2
Browse files Browse the repository at this point in the history
rootView:didLoadFinish: callback
  • Loading branch information
wwwcg authored and hippy-actions[bot] committed Nov 23, 2023
1 parent d4026a2 commit 538aa1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions renderer/native/ios/renderer/HippyRootView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ - (instancetype)initWithBridge:(HippyBridge *)bridge
} else {
__weak __typeof(self)weakSelf = self;
[bridge loadBundleURL:businessURL completion:^(NSURL * _Nullable url, NSError * _Nullable error) {
// Execute loadInstance first and then do call back, maintain compatibility with hippy2
if (!error) {
[weakSelf runHippyApplication];
}
dispatch_async(dispatch_get_main_queue(), ^{
__strong __typeof(weakSelf)strongSelf = weakSelf;
// 抛出业务包(BusinessBundle aka SecondaryBundle)加载完成通知, for hippy2兼容
Expand All @@ -145,9 +149,6 @@ - (instancetype)initWithBridge:(HippyBridge *)bridge
[delegate rootView:strongSelf didLoadFinish:(error == nil)];
}
});
if (!error) {
[weakSelf runHippyApplication];
}
}];
}
}
Expand Down

0 comments on commit 538aa1c

Please sign in to comment.