Fires keep burning through a re-render

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-21 12:29:40 +01:00
parent 54ae3ae641
commit a02a81dffd

View file

@ -277,7 +277,14 @@ function render() {
setHtml($("#side"), S.me ? sidebar() : `<div class="brand"><img src="/static/icon.svg" alt="">Guildhall <small>alpha</small></div>${S.dev ? devbar() : ""}`);
setHtml($("#top"), topbar());
// The fires keep burning through a re-render: put the old canvases back in place of the new ones.
const burning = [...document.querySelectorAll("canvas[data-flame]")];
setHtml($("#main"), S.me ? pageHtml() : register());
for (const old of burning) {
const fresh = document.querySelector(`canvas[data-flame="${old.dataset.flame}"]`);
if (fresh && fresh !== old) fresh.replaceWith(old);
}
fireTextAt = 0; // and fill in their bars and times straight away
for (const [key, value] of Object.entries(kept)) {
const el = document.querySelector(`[data-keep="${key}"]`);