Skip to content

Commit

Permalink
have Friends tab only show posts from friends
Browse files Browse the repository at this point in the history
  • Loading branch information
annacai44 committed Jan 21, 2025
1 parent 156914a commit 1526c5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function App() {
{/* Protected routes => must be logged in or dev */}
<Route
path="/feed"
element={isAuthenticated ? <Feed /> : <Navigate to="/" />}
element={isAuthenticated ? <Feed friends={friends} /> : <Navigate to="/" />}
/>
<Route
path="/submission"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Feed/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Feed({friends}) {
setFilteredPosts(posts);
} else {
// friends
setFilteredPosts(posts.filter(post => friends.includes(post.username)));
setFilteredPosts(posts.filter(post => friends.some(friend => friend.displayName === post.username)));
}
};

Expand Down

0 comments on commit 1526c5a

Please sign in to comment.