From 9b555c88c41f37afda53d8f931424c6a91e44374 Mon Sep 17 00:00:00 2001 From: nicktytarenko Date: Sat, 17 Jan 2026 17:40:31 +0200 Subject: [PATCH] Fix: Prevent Multiple Comment API Requests When Switching Tabs --- components/work/WorkDocument.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/work/WorkDocument.tsx b/components/work/WorkDocument.tsx index 4ef3789dc..29d5d9ffb 100644 --- a/components/work/WorkDocument.tsx +++ b/components/work/WorkDocument.tsx @@ -72,9 +72,9 @@ export const WorkDocument = ({ work, metadata, defaultTab = 'paper' }: WorkDocum }, [defaultTab]); // Handle tab change (updates URL via WorkTabs now) - const handleTabChange = (tab: TabType) => { + const handleTabChange = useCallback((tab: TabType) => { setActiveTab(tab); - }; + }, []); const isAuthor = useMemo(() => { if (!user) return false;