From 919542f8fc699917bdad26e8a196e0affdbac94b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 4 Jun 2021 15:36:01 +0200 Subject: [PATCH] Don't assume container node exists when loading bundle Only look for the container node when needed --- src/platform/web/ui/common.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platform/web/ui/common.js b/src/platform/web/ui/common.js index 9fbafcdf..15a522c7 100644 --- a/src/platform/web/ui/common.js +++ b/src/platform/web/ui/common.js @@ -14,10 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -const container = document.querySelector(".hydrogen"); +let container; export function spinner(t, extraClasses = undefined) { - if (container.classList.contains("legacy")) { + if (container === undefined) { + container = document.querySelector(".hydrogen"); + } + if (container?.classList.contains("legacy")) { return t.div({className: "spinner"}, [ t.div(), t.div(),