mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Removing kiwis fix since this was fixed in auth tokens branch
This commit is contained in:
@@ -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'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user