fix(recent-projects): close context switch response race
This commit is contained in:
parent
b46b53d667
commit
96478a604f
1 changed files with 1 additions and 4 deletions
|
|
@ -110,6 +110,7 @@ export function useRecentProjectsSection(
|
||||||
initialSnapshot?.payload.projects ?? []
|
initialSnapshot?.payload.projects ?? []
|
||||||
);
|
);
|
||||||
const activeContextIdRef = useRef(activeContextId);
|
const activeContextIdRef = useRef(activeContextId);
|
||||||
|
activeContextIdRef.current = activeContextId;
|
||||||
const provisioningState = useMemo(
|
const provisioningState = useMemo(
|
||||||
() => ({ currentProvisioningRunIdByTeam, provisioningRuns }),
|
() => ({ currentProvisioningRunIdByTeam, provisioningRuns }),
|
||||||
[currentProvisioningRunIdByTeam, provisioningRuns]
|
[currentProvisioningRunIdByTeam, provisioningRuns]
|
||||||
|
|
@ -130,10 +131,6 @@ export function useRecentProjectsSection(
|
||||||
recentProjectsRef.current = recentProjects;
|
recentProjectsRef.current = recentProjects;
|
||||||
}, [recentProjects]);
|
}, [recentProjects]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
activeContextIdRef.current = activeContextId;
|
|
||||||
}, [activeContextId]);
|
|
||||||
|
|
||||||
const reload = useCallback(
|
const reload = useCallback(
|
||||||
async (options?: { force?: boolean }): Promise<void> => {
|
async (options?: { force?: boolean }): Promise<void> => {
|
||||||
const requestContextId = activeContextId;
|
const requestContextId = activeContextId;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue