From ec19618052eb15e98aee45a1f43a83c244774129 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 16 May 2017 17:13:41 +0700 Subject: [PATCH] Readd login fixes --- client/coral-settings/containers/ProfileContainer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js index 04e337b47..84c2c1642 100644 --- a/client/coral-settings/containers/ProfileContainer.js +++ b/client/coral-settings/containers/ProfileContainer.js @@ -25,6 +25,14 @@ class ProfileContainer extends Component { }; } + componentWillReceiveProps(nextProps) { + if (this.props.auth.loggedIn !== nextProps.auth.loggedIn) { + + // Refetch after login/logout. + this.props.data.refetch(); + } + } + handleTabChange = (tab) => { this.setState({ activeTab: tab @@ -39,7 +47,7 @@ class ProfileContainer extends Component { return ; } - if (data.loading) { + if (!me || data.loading) { return ; }