From 5d606295ef3b7afcb6afaa05d9932edf439264aa Mon Sep 17 00:00:00 2001
From: Matt Kirby <MattJKirby@outlook.com>
Date: Thu, 20 Apr 2023 18:31:25 +0100
Subject: [PATCH] Fixed issue with feed not loading

---
 daily-thought-frontend/src/hooks/useFeed.ts | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/daily-thought-frontend/src/hooks/useFeed.ts b/daily-thought-frontend/src/hooks/useFeed.ts
index 20ecbf84..e5105492 100644
--- a/daily-thought-frontend/src/hooks/useFeed.ts
+++ b/daily-thought-frontend/src/hooks/useFeed.ts
@@ -38,7 +38,6 @@ export const useFeed = ({ user, questionData }: UseFeedProps) => {
       const response = await fetch(endpoint, { headers });
 
       if (!response.ok) {
-        console.log(true, response);
       } else {
         return await response.json();
       }
@@ -59,11 +58,11 @@ export const useFeed = ({ user, questionData }: UseFeedProps) => {
   };
 
   useEffect(() => {
-    if (!rehydrateFeedUsers && feed) return;
+    if (!rehydrateFeedUsers) return;
 
     const userSet = new Set<string>([]);
-    if (feed) {
-      userSet.add(feed.userDaily.userId);
+    if (user) {
+      userSet.add(user.id);
     }
 
     feed?.feed.forEach((post: FeedPost) => {
@@ -85,7 +84,6 @@ export const useFeed = ({ user, questionData }: UseFeedProps) => {
         }
       });
     }
-
     setRehydrateFeedUsers(false);
   });
 
-- 
GitLab