Merge pull request #1112 from coralproject/my-profile-tab-fix

Load username from graph and not auth
This commit is contained in:
Kim Gardner
2017-10-18 19:31:07 +01:00
committed by GitHub
@@ -53,7 +53,7 @@ class ProfileContainer extends Component {
};
render() {
const {auth, auth: {user}, showSignInDialog, root, data} = this.props;
const {auth, auth: {user: authUser}, showSignInDialog, root, data} = this.props;
const {me} = this.props.root;
const loading = this.props.data.loading;
@@ -65,14 +65,14 @@ class ProfileContainer extends Component {
return <Spinner />;
}
const localProfile = user.profiles.find(
const localProfile = authUser.profiles.find(
(p) => p.provider === 'local'
);
const emailAddress = localProfile && localProfile.id;
return (
<div className='talk-embed-stream-profile-container'>
<h2>{user.username}</h2>
<h2>{me.username}</h2>
{emailAddress ? <p>{emailAddress}</p> : null}
<Slot
@@ -82,7 +82,6 @@ class ProfileContainer extends Component {
/>
<hr />
<h3>{t('framework.my_comments')}</h3>
{me.comments.nodes.length
? <CommentHistory data={data} root={root} comments={me.comments} link={link} loadMore={this.loadMore}/>
@@ -140,6 +139,7 @@ const withProfileQuery = withQuery(
query CoralEmbedStream_Profile {
me {
id
username
comments(query: {limit: 10}) {
...TalkSettings_CommentConnectionFragment
}