Skip to content

Commit

Permalink
fix: wait to load items until user is authenticated to prevent items …
Browse files Browse the repository at this point in the history
…not being fetched
  • Loading branch information
fredrikmonsen committed Nov 13, 2024
1 parent aca90c2 commit b6716be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ export default function Home() {
};

useEffect(() => {
if (!user) {
return;
}
void getItems();
}, []);
}, [user]);

const handleItemClicked = async (id: string) => {
if (!user) {
Expand Down

0 comments on commit b6716be

Please sign in to comment.