this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix noob mistake

And also make announcements and follow requests fetch more non-blocking

+17 -12
+17 -12
src/pages/notifications.jsx
··· 134 134 (async () => { 135 135 try { 136 136 const fetchNotificationsPromise = fetchNotifications(firstLoad); 137 - const fetchFollowRequestsPromise = fetchFollowRequests(); 138 - const fetchAnnouncementsPromise = fetchAnnouncements(); 139 137 140 138 if (firstLoad) { 141 - const announcements = await fetchAnnouncementsPromise; 142 - announcements.sort((a, b) => { 143 - // Sort by updatedAt first, then createdAt 144 - const aDate = new Date(a.updatedAt || a.createdAt); 145 - const bDate = new Date(b.updatedAt || b.createdAt); 146 - return bDate - aDate; 147 - }); 148 - setAnnouncements(announcements); 149 - const requests = await fetchFollowRequestsPromise; 150 - setFollowRequests(requests); 139 + fetchAnnouncements() 140 + .then((announcements) => { 141 + announcements.sort((a, b) => { 142 + // Sort by updatedAt first, then createdAt 143 + const aDate = new Date(a.updatedAt || a.createdAt); 144 + const bDate = new Date(b.updatedAt || b.createdAt); 145 + return bDate - aDate; 146 + }); 147 + setAnnouncements(announcements); 148 + }) 149 + .catch(() => {}); 150 + 151 + fetchFollowRequests() 152 + .then((requests) => { 153 + setFollowRequests(requests); 154 + }) 155 + .catch(() => {}); 151 156 } 152 157 153 158 const { done } = await fetchNotificationsPromise;