visproj commited on
Commit
87f1d25
ยท
verified ยท
1 Parent(s): 69091a1

fix: dismissed end banner no longer flashes when a new run starts

Browse files
Files changed (1) hide show
  1. web/app.js +4 -1
web/app.js CHANGED
@@ -221,9 +221,11 @@ function select(i, follow) {
221
 
222
  // โ”€โ”€ event intake โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
223
  function resetView() {
 
 
224
  state.endingDismissed = false;
 
225
  stopReplay();
226
- state.events = []; state.turns = []; state.selected = -1; state.follow = true;
227
  if (window.Lantern3D) window.Lantern3D.reset();
228
  $("timeline").replaceChildren();
229
  renderMind(null);
@@ -305,6 +307,7 @@ async function startRun(evt) {
305
  evt.preventDefault();
306
  const body = { task: $("task").value, seed: Number($("seed").value) || 0, use_lessons: $("lessons").checked };
307
  $("start").disabled = true;
 
308
  showNotice("");
309
  try {
310
  const { id } = await api("/api/runs", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
 
221
 
222
  // โ”€โ”€ event intake โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
223
  function resetView() {
224
+ // Clear the old run before anything re-renders, or its ending banner flashes back up.
225
+ state.events = []; state.turns = []; state.selected = -1; state.follow = true;
226
  state.endingDismissed = false;
227
+ $("ending").hidden = true;
228
  stopReplay();
 
229
  if (window.Lantern3D) window.Lantern3D.reset();
230
  $("timeline").replaceChildren();
231
  renderMind(null);
 
307
  evt.preventDefault();
308
  const body = { task: $("task").value, seed: Number($("seed").value) || 0, use_lessons: $("lessons").checked };
309
  $("start").disabled = true;
310
+ $("ending").hidden = true;
311
  showNotice("");
312
  try {
313
  const { id } = await api("/api/runs", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });