From 96478a604f9033de4722f9d318d33c6756f9dbee Mon Sep 17 00:00:00 2001 From: 777genius Date: Tue, 26 May 2026 16:40:24 +0300 Subject: [PATCH] fix(recent-projects): close context switch response race --- .../renderer/hooks/useRecentProjectsSection.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/features/recent-projects/renderer/hooks/useRecentProjectsSection.ts b/src/features/recent-projects/renderer/hooks/useRecentProjectsSection.ts index 3eddb523..187851a1 100644 --- a/src/features/recent-projects/renderer/hooks/useRecentProjectsSection.ts +++ b/src/features/recent-projects/renderer/hooks/useRecentProjectsSection.ts @@ -110,6 +110,7 @@ export function useRecentProjectsSection( initialSnapshot?.payload.projects ?? [] ); const activeContextIdRef = useRef(activeContextId); + activeContextIdRef.current = activeContextId; const provisioningState = useMemo( () => ({ currentProvisioningRunIdByTeam, provisioningRuns }), [currentProvisioningRunIdByTeam, provisioningRuns] @@ -130,10 +131,6 @@ export function useRecentProjectsSection( recentProjectsRef.current = recentProjects; }, [recentProjects]); - useEffect(() => { - activeContextIdRef.current = activeContextId; - }, [activeContextId]); - const reload = useCallback( async (options?: { force?: boolean }): Promise => { const requestContextId = activeContextId;