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

There's an obscure bug where really slow devices end up removing the splash screen before they're finished parsing all of the Discourse assets.

This PR won't impact fast devices but should hopefully prevent the premature removal of the splash on super slow devices.
This commit is contained in:
Joe 2022-06-24 17:39:26 +08:00 committed by GitHub
parent e993a23a54
commit 529c5e343d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -82,8 +82,14 @@ const Discourse = Application.extend({
}); });
}); });
// The app booted. Remove the splash screen window.addEventListener(
document.querySelector("#d-splash")?.remove(); "load",
() => {
// The app booted. Remove the splash screen
document.querySelector("#d-splash")?.remove();
},
{ once: true }
);
}, },
_registerPluginCode(version, code) { _registerPluginCode(version, code) {