Removing kiwis fix since this was fixed in auth tokens branch

This commit is contained in:
Belen Curcio
2017-05-15 17:23:57 -03:00
parent b2e5c0452a
commit b789a8e107
2 changed files with 5 additions and 38 deletions
-26
View File
@@ -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();
});
};
@@ -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 <NotLoggedIn showSignInDialog={showSignInDialog} />;
}
if (data.loading) {
return <Spinner />;
}
if (!me) {
return <NotLoggedIn showSignInDialog={showSignInDialog} />;
}
const localProfile = this.props.user.profiles.find(
p => p.provider === 'local'
);