fix: keep stop button enabled until task fully ends

This commit is contained in:
root
2026-03-19 00:13:39 +08:00
parent fb64be5ba2
commit db57ccf50c

View File

@@ -1004,7 +1004,7 @@ function syncTaskChrome() {
const hasLiveRun = Boolean(state.task.run_id) && !state.task.finished_at; const hasLiveRun = Boolean(state.task.run_id) && !state.task.finished_at;
const isActive = ['starting', 'running'].includes(status); const isActive = ['starting', 'running'].includes(status);
const isStopping = status === 'stopping'; const isStopping = status === 'stopping';
const canStop = ['starting', 'running', 'stopping', 'failed'].includes(status) || hasLiveRun; const canStop = !['idle', 'stopped', 'finished'].includes(status);
DOM.btnStart.disabled = hasLiveRun || isStopping; DOM.btnStart.disabled = hasLiveRun || isStopping;
DOM.btnStop.disabled = !canStop; DOM.btnStop.disabled = !canStop;
DOM.progressFill.className = isActive DOM.progressFill.className = isActive