From 6c69f590cf18d1224445ee86da7c85c7663f5fb7 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sun, 8 Dec 2024 02:22:56 +0100 Subject: [PATCH 1/2] WebHost: fix host room not updating (ports in) slot table (#4308) --- WebHostLib/templates/hostRoom.html | 11 +++++++++-- WebHostLib/templates/macros.html | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/WebHostLib/templates/hostRoom.html b/WebHostLib/templates/hostRoom.html index 8e76dafc12fa..c5996d181ee0 100644 --- a/WebHostLib/templates/hostRoom.html +++ b/WebHostLib/templates/hostRoom.html @@ -178,8 +178,15 @@ }) .then(text => new DOMParser().parseFromString(text, 'text/html')) .then(newDocument => { - let el = newDocument.getElementById("host-room-info"); - document.getElementById("host-room-info").innerHTML = el.innerHTML; + ["host-room-info", "slots-table"].forEach(function(id) { + const newEl = newDocument.getElementById(id); + const oldEl = document.getElementById(id); + if (oldEl && newEl) { + oldEl.innerHTML = newEl.innerHTML; + } else if (newEl) { + console.warn(`Did not find element to replace for ${id}`) + } + }); }); } diff --git a/WebHostLib/templates/macros.html b/WebHostLib/templates/macros.html index 6b2a4b0ed784..b95b8820a72f 100644 --- a/WebHostLib/templates/macros.html +++ b/WebHostLib/templates/macros.html @@ -8,7 +8,7 @@ {%- endmacro %} {% macro list_patches_room(room) %} {% if room.seed.slots %} -
Id | From e3b5451672c694c12974801f5c89cc172db3ff5a Mon Sep 17 00:00:00 2001 From: qwint
---|