Skip to content

Commit

Permalink
fixed username showing for anonymous post (but still shows anonymous …
Browse files Browse the repository at this point in the history
…for friends page)
  • Loading branch information
lestertai8 committed Feb 2, 2025
1 parent bc1b594 commit 33e94ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Comment/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ function Comment({ userName, profilePic, setLikedPosts }) {
const posts = [];
doc.forEach((doc) => {
if (doc.id === post_id) {
posts.push({ id: doc.id, ...doc.data() });
posts.push({ id: doc.id, ...doc.data(), username: doc.data().anonymous ? "Anonymous" : doc.data().username });
// post.anonymous ? "Anonymous" : post.username
// updates username depending on anonymity
}
});
return posts[0];
Expand Down

0 comments on commit 33e94ed

Please sign in to comment.