Fires keep burning through a re-render
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
54ae3ae641
commit
a02a81dffd
1 changed files with 7 additions and 0 deletions
|
|
@ -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($("#side"), S.me ? sidebar() : `<div class="brand"><img src="/static/icon.svg" alt="">Guildhall <small>alpha</small></div>${S.dev ? devbar() : ""}`);
|
||||||
setHtml($("#top"), topbar());
|
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());
|
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)) {
|
for (const [key, value] of Object.entries(kept)) {
|
||||||
const el = document.querySelector(`[data-keep="${key}"]`);
|
const el = document.querySelector(`[data-keep="${key}"]`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue