mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-12 13:36:43 +00:00
fix: use current user info when writing a comment
This commit is contained in:
parent
88efe1a33b
commit
6651d1be13
1 changed files with 5 additions and 3 deletions
|
|
@ -21,10 +21,12 @@ interface IProps extends WithFirestoreProps {
|
||||||
/**
|
/**
|
||||||
* Display a Post and the related comments. Shows a form to add a comment.
|
* Display a Post and the related comments. Shows a form to add a comment.
|
||||||
*/
|
*/
|
||||||
const PostPage: FC<IProps> = ({post, firestore}) => {
|
const PostPage: FC<IProps> = ({post, firestore, firebase}) => {
|
||||||
|
const name = firebase.auth().currentUser?.displayName;
|
||||||
|
const avatarUrl = firebase.auth().currentUser?.photoURL;
|
||||||
const newComment: Comment = {
|
const newComment: Comment = {
|
||||||
name: post.name ?? 'error',
|
name: name ?? 'error',
|
||||||
avatarUrl: post.avatarUrl ?? 'error',
|
avatarUrl: avatarUrl ?? 'error',
|
||||||
text: '',
|
text: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue