mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-26 08:47:36 +08:00
refactor: ready function now awaits config to be loaded to avoid concurrency issues
This commit is contained in:
parent
a670438bb9
commit
baaea33490
1 changed files with 7 additions and 6 deletions
|
|
@ -8,8 +8,10 @@ import * as AccountButton from "./elements/account-button";
|
|||
import Konami from "konami";
|
||||
import * as ServerConfiguration from "./ape/server-configuration";
|
||||
import { getActiveFunboxes } from "./test/funbox/list";
|
||||
import { loadPromise } from "./config";
|
||||
|
||||
$((): void => {
|
||||
$(async (): Promise<void> => {
|
||||
await loadPromise;
|
||||
Misc.loadCSS("/css/slimselect.min.css", true);
|
||||
Misc.loadCSS("/css/balloon.min.css", true);
|
||||
|
||||
|
|
@ -19,11 +21,10 @@ $((): void => {
|
|||
//to make sure the initial theme application doesnt animate the background color
|
||||
$("body").css("transition", "background .25s, transform .05s");
|
||||
MerchBanner.showIfNotClosedBefore();
|
||||
setTimeout(() => {
|
||||
for (const fb of getActiveFunboxes()) {
|
||||
fb.functions?.applyGlobalCSS?.();
|
||||
}
|
||||
}, 500); //this approach will probably bite me in the ass at some point
|
||||
|
||||
for (const fb of getActiveFunboxes()) {
|
||||
fb.functions?.applyGlobalCSS?.();
|
||||
}
|
||||
|
||||
$("#app")
|
||||
.css("opacity", "0")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue