diff --git a/web/app.js b/web/app.js index f7f068c..11d5330 100644 --- a/web/app.js +++ b/web/app.js @@ -2347,3 +2347,30 @@ async function closeSlot(slot, label, pnl) { if (a) a.onclick = () => closeSlot("main", "Slot 1", letzterSnap && letzterSnap.position ? letzterSnap.position.pnl : null); if (b) b.onclick = () => closeSlot("brk", "BRK", letzterSnap && letzterSnap.position_brk ? letzterSnap.position_brk.pnl : null); } + + +// --- Cache-Wächter: passt die HTML zum JS? --------------------------------- +// ⚠⚠ WOZU. `index.html` wird vom `?v=`-Bump NICHT gebustet — nur `app.js` und +// `style.css`. Trifft neues JS auf eine alte, gecachte HTML, fehlen die neuen +// Elemente; das Auffang-`$` verhindert zwar den Absturz, aber die Anzeige ist +// still unvollstaendig. Real passiert am 19.08. (M5-/RSI-Zeile) und am 20.08. +// (Close-Knoepfe an den G/V-Anzeigen) — beide Male sah der Server korrekt aus +// und der Browser zeigte Altes. Statt das jedes Mal von Hand zu diagnostizieren, +// sagt die Seite es jetzt selbst. +// ⚠ Bewusst SICHTBAR statt nur Konsole: die Konsole sieht am Handy niemand. +const _JS_V = "199"; +{ + const htmlV = document.body && document.body.dataset + ? document.body.dataset.htmlV : null; + if (htmlV && htmlV !== _JS_V) { + const b = document.createElement("div"); + b.style.cssText = "position:fixed;left:0;right:0;bottom:0;z-index:9999;" + + "background:#8b1a1a;color:#fff;padding:.6rem;text-align:center;" + + "font:600 .9rem system-ui,sans-serif;cursor:pointer"; + b.textContent = `⚠ Alte Seite im Cache (HTML v${htmlV}, JS v${_JS_V}) ` + + `— hier tippen zum Neuladen`; + b.onclick = () => location.replace( + location.pathname + "?x" + Date.now()); + document.body.appendChild(b); + } +} diff --git a/web/index.html b/web/index.html index 126a92d..a25a843 100644 --- a/web/index.html +++ b/web/index.html @@ -14,7 +14,7 @@ - +