From 5ede8df52ab1bd4efd0e0627b8775178cf3acdd4 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 02:28:47 +0000 Subject: [PATCH] Fix inverted cancel guard in cockpit project loader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: #102 rewrote the bare-array fallback into a multi-line callback and turned 'if (!c) setProjects(...)' into an early 'if (!c) return', which skips setProjects on the normal (non-cancelled) path — the cockpit then hangs on 加载中 forever, caught by I4 e2e scenario 1. Evidence: tsc clean, vitest 324/324, build green (SELF); seven-scenario browser suite rerun recorded on the Dev I4 card. Impact: cockpit entry only. Refs: rollout I4 --- src/components/DocumentCockpit.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DocumentCockpit.tsx b/src/components/DocumentCockpit.tsx index 8f33889..b3da2b2 100644 --- a/src/components/DocumentCockpit.tsx +++ b/src/components/DocumentCockpit.tsx @@ -66,7 +66,7 @@ export function DocumentCockpit() { setProjects(null); setPid(''); setOverview(null); setSelected(null); setFilter(''); setError('') api.rdmCommand<{ projects?: ProjectView[] } | ProjectView[]>('rdm.project.list') .then(list => { - if (!c) return + if (c) return // rdm.project.list 返回 { projects: [...] };容忍裸数组形态。 const rows = Array.isArray(list) ? list : (list?.projects ?? []) setProjects(rows)