From cb702baeb2600cc5cf4b9ba227f22eff2e7fac51 Mon Sep 17 00:00:00 2001 From: NI Date: Mon, 12 Aug 2019 09:46:34 +0800 Subject: [PATCH] Fixed a bug: Don't remove "landing" twice. --- ui/app.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ui/app.js b/ui/app.js index bf9a066..da0db92 100644 --- a/ui/app.js +++ b/ui/app.js @@ -57,8 +57,6 @@ const mainTemplate = ` `.trim(); -let clientInitialized = false; - function startApp(rootEl) { let uiControlColor = new ControlColor(); @@ -279,15 +277,12 @@ function startApp(rootEl) { } function initializeClient() { - if (clientInitialized) { + let landingRoot = document.getElementById("landing"); + + if (!landingRoot) { return; } - clientInitialized = true; - - document.body.classList.remove("landing"); - - let landingRoot = document.getElementById("landing"); landingRoot.parentNode.removeChild(landingRoot); let normalRoot = document.createElement("div");