diff --git a/client/pages/Feed.tsx b/client/pages/Feed.tsx index 96dd5096..e2577d60 100644 --- a/client/pages/Feed.tsx +++ b/client/pages/Feed.tsx @@ -112,20 +112,11 @@ export default function Feed() { const fetchFeed = useCallback(async () => { setIsLoading(true); try { - // Add timeout to prevent hanging indefinitely - const withTimeout = (promise: Promise, ms: number): Promise => - Promise.race([ - promise, - new Promise((_, reject) => - setTimeout(() => reject(new Error("Request timeout")), ms) - ), - ]); - - // Parallelize posts and following fetch with 10s timeout + // Parallelize posts and following fetch const [posts, flw] = await Promise.all([ - withTimeout(communityService.getPosts(30), 10000), + communityService.getPosts(30), user?.id - ? withTimeout(aethexSocialService.getFollowing(user.id), 10000) + ? aethexSocialService.getFollowing(user.id) : Promise.resolve([]), ]);