Async await (again) (right way this time)

This commit is contained in:
b 2021-06-19 00:25:20 -07:00
parent 451b0af017
commit 6b52b27585
3 changed files with 8 additions and 4 deletions

View file

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html scroll-behavior="smooth">
<head>
<meta charset="UTF-8" />
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width, user-scalable=no" />
<!-- nunito font, copying wynndata -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">

View file

@ -146,7 +146,9 @@ async function load_init(init_func) {
else {
if (load_in_progress) {
while (!load_complete) {
(async function () {
await sleep(100);
}) ()
}
init_func();
}

View file

@ -125,7 +125,7 @@ async function load(init_func) {
// DB not closed? idfk man
}
async function load_init(init_func) {
function load_init(init_func) {
if (load_complete) {
console.log("Item db already loaded, skipping load sequence");
init_func();
@ -146,7 +146,9 @@ async function load_init(init_func) {
else {
if (load_in_progress) {
while (!load_complete) {
(async function () {
await sleep(100);
}) ()
}
init_func();
}