From f82a56e2ca6007c89ca2be112a45823d37637ce2 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 5 Nov 2025 07:11:17 +0000 Subject: [PATCH] completionId: cgen-0e31190aaa9247d69a7ad9bebc4a8e12 cgen-0e31190aaa9247d69a7ad9bebc4a8e12 --- client/pages/Feed.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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([]), ]);