Skip to content

A platform for community discussion. Free, open, simple.

FIX: Defer removing the splash screen until the window load event fires take 2 (#17230)

Joe529c5e343d3d
diff --git a/app/assets/javascripts/discourse/app/app.js b/app/assets/javascripts/discourse/app/app.js
index 3ff0205cccc..be305596c42 100644
--- a/app/assets/javascripts/discourse/app/app.js
+++ b/app/assets/javascripts/discourse/app/app.js
@@ -82,8 +82,14 @@ const Discourse = Application.extend({
});
});
- // The app booted. Remove the splash screen
- document.querySelector("#d-splash")?.remove();
+ window.addEventListener(
+ "load",
+ () => {
+ // The app booted. Remove the splash screen
+ document.querySelector("#d-splash")?.remove();
+ },
+ { once: true }
+ );
},
_registerPluginCode(version, code) {