From b789a8e107b659d71a3f947b0097db9b33251064 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 15 May 2017 17:23:57 -0300 Subject: [PATCH] Removing kiwis fix since this was fixed in auth tokens branch --- client/coral-framework/actions/auth.js | 26 ------------------- .../containers/ProfileContainer.js | 17 ++++-------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/client/coral-framework/actions/auth.js b/client/coral-framework/actions/auth.js index 27e1fed97..5e7c72934 100644 --- a/client/coral-framework/actions/auth.js +++ b/client/coral-framework/actions/auth.js @@ -10,31 +10,6 @@ const lang = new I18n(translations); import translations from './../translations'; import I18n from '../../coral-framework/modules/i18n/i18n'; -const ME_QUERY = gql` - query Me { - me { - status - comments { - id - body - asset { - id - title - url - } - created_at - } - } - } -`; - -function fetchMe() { - return client.query({ - fetchPolicy: 'network-only', - query: ME_QUERY - }); -} - // Dialog Actions export const showSignInDialog = () => dispatch => { const signInPopUp = window.open( @@ -292,7 +267,6 @@ export const logout = () => dispatch => { return coralApi('/auth', {method: 'DELETE'}).then(() => { dispatch({type: actions.LOGOUT}); Storage.removeItem('token'); - fetchMe(); }); }; diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js index eb8cc3e1d..c72536d8a 100644 --- a/client/coral-settings/containers/ProfileContainer.js +++ b/client/coral-settings/containers/ProfileContainer.js @@ -25,13 +25,6 @@ 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,17 +32,17 @@ class ProfileContainer extends Component { }; render() { - const {asset, data, showSignInDialog, stopIgnoringUser} = this.props; + const {auth, asset, data, showSignInDialog, stopIgnoringUser} = this.props; const {me} = this.props.data; + if (!auth.loggedIn) { + return ; + } + if (data.loading) { return ; } - if (!me) { - return ; - } - const localProfile = this.props.user.profiles.find( p => p.provider === 'local' );