feat(FN-5148): complete Step 1 — guard updateDetailTask id drift

Fusion-Task-Id: FN-5148
Fusion-Task-Lineage: af70f85f-ec90-4040-bbf3-9e1bce3a49b9
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 08:01:19 -07:00
committed by gsxdsm
parent b6b1af240a
commit 7d94cc367b

View File

@@ -247,7 +247,13 @@ export function useModalManager(options: UseModalManagerOptions): ModalManager {
setDetailTaskOrigin(null);
}, []);
const updateDetailTask = useCallback((updated: Partial<TaskDetail>) => {
setDetailTask((prev) => (prev ? { ...prev, ...updated } : prev));
setDetailTask((prev) => {
if (!prev) return prev;
if (updated.id !== undefined && updated.id !== prev.id) {
return prev;
}
return { ...prev, ...updated };
});
}, []);
const closeDetailTask = useCallback(() => {
setDetailTask(null);