fix(recent-projects): close context switch response race

This commit is contained in:
777genius 2026-05-26 16:40:24 +03:00
parent b46b53d667
commit 96478a604f

View file

@ -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<void> => {
const requestContextId = activeContextId;