diff --git a/static/main.js b/static/main.js index 413e66c..fddc404 100644 --- a/static/main.js +++ b/static/main.js @@ -777,7 +777,6 @@ async function renderVMAdmin() { async function pollTask(upid, node, onUpdate, onDone) { - let lastSt = null; let lastSt = null; if (!upid || !node) return; const started = Date.now(); @@ -788,7 +787,9 @@ async function pollTask(upid, node, onUpdate, onDone) { const r = await fetch('/api/task-status?upid=' + encodeURIComponent(upid) + '&node=' + encodeURIComponent(node)); const d = await r.json(); if (d && d.ok) { - const st = d.status || {}; lastSt = st; lastSt = st; if (onUpdate) { try { onUpdate(st); } catch { } } + const st = d.status || {}; + lastSt = st; + if (onUpdate) { try { onUpdate(st); } catch { } } const s = (st.status || '').toLowerCase(); if (s === 'stopped' || st.exitstatus) break; }