From fb9760b5a600b8d5052f3a12c2b12b6e73f1c645 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 22 Mar 2018 16:08:03 +0200 Subject: [PATCH] MM-9921 Load select team screen when user has no teams (#1527) * MM-9921 Load select team screen when user has no teams * Revert to PureComponent --- app/components/root/root.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/components/root/root.js b/app/components/root/root.js index 1237dd29a..59b0632c9 100644 --- a/app/components/root/root.js +++ b/app/components/root/root.js @@ -22,7 +22,7 @@ export default class Root extends PureComponent { theme: PropTypes.object.isRequired, }; - componentDidMount() { + componentWillMount() { if (!this.props.excludeEvents) { EventEmitter.on(ViewTypes.NOTIFICATION_IN_APP, this.handleInAppNotification); EventEmitter.on(ViewTypes.NOTIFICATION_TAPPED, this.handleNotificationTapped); @@ -56,6 +56,11 @@ export default class Root extends PureComponent { }; handleNoTeams = () => { + if (!this.refs.provider) { + setTimeout(this.handleNoTeams, 200); + return; + } + const {currentUrl, navigator, theme} = this.props; const {intl} = this.refs.provider.getChildContext();