mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 05:53:30 +08:00
load username from graph and not auth
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user