fix(application): explicitly pass rootView to initRootView (#10345)

fixes occasional crashes when resuming the app.
This commit is contained in:
Jason Cassidy
2023-07-18 16:47:50 +01:00
committed by GitHub
parent 6effd554f2
commit bd8e1b8e79
3 changed files with 5 additions and 5 deletions

View File

@ -364,8 +364,8 @@ export class ApplicationCommon {
// rest of implementation is platform specific // rest of implementation is platform specific
} }
initRootView() { initRootView(rootView: View) {
this.setRootViewCSSClasses(this.getRootView()); this.setRootViewCSSClasses(rootView);
initAccessibilityCssHelper(); initAccessibilityCssHelper();
initAccessibilityFontScale(); initAccessibilityFontScale();
} }

View File

@ -157,7 +157,7 @@ export class iOSApplication extends ApplicationCommon implements IiOSApplication
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null); visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
} }
this.initRootView(); this.initRootView(rootView);
this.notifyAppStarted(); this.notifyAppStarted();
} }
@ -349,7 +349,7 @@ export class iOSApplication extends ApplicationCommon implements IiOSApplication
this._window.makeKeyAndVisible(); this._window.makeKeyAndVisible();
} }
this.initRootView(); this.initRootView(rootView);
rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => { rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => {
const userInterfaceStyle = controller.traitCollection.userInterfaceStyle; const userInterfaceStyle = controller.traitCollection.userInterfaceStyle;

View File

@ -1378,7 +1378,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
this._rootView = rootView; this._rootView = rootView;
// sets root classes once rootView is ready... // sets root classes once rootView is ready...
Application.initRootView(); Application.initRootView(rootView);
} }
} }