diff --git a/web/app.js b/web/app.js index 915716c..3820116 100644 --- a/web/app.js +++ b/web/app.js @@ -1191,14 +1191,14 @@ function renderTranscript(messages) { function renderPreview() { const root = $('#previewRoot'); if (!S.previewId) { root.hidden = true; root.innerHTML = ''; return; } - const t = S.approvals.find((x) => x.id === S.previewId) || S.tasks.find((x) => x.id === S.previewId); + const task = S.approvals.find((x) => x.id === S.previewId) || S.tasks.find((x) => x.id === S.previewId); // 任务已离开闸(被裁决/状态变化)→ 自动关闭 - if (!t || !GATE_OF[t.status]) { S.previewId = null; S.previewReject = false; root.hidden = true; root.innerHTML = ''; return; } - const gate = GATE_OF[t.status]; + if (!task || !GATE_OF[task.status]) { S.previewId = null; S.previewReject = false; root.hidden = true; root.innerHTML = ''; return; } + const gate = GATE_OF[task.status]; const pp = S.projects.find((x) => x.id === S.currentProjectId); const defBranch = pp ? pp.defaultBranch : 'main'; const onlyPassBtn = gate === 'exec' - ? `` + ? `` : ''; root.hidden = false; root.innerHTML = ` @@ -1206,28 +1206,28 @@ function renderPreview() {