mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-06 02:36:39 +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.
|
||||
*/
|
||||
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 = {
|
||||
name: post.name ?? 'error',
|
||||
avatarUrl: post.avatarUrl ?? 'error',
|
||||
name: name ?? 'error',
|
||||
avatarUrl: avatarUrl ?? 'error',
|
||||
text: '',
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue