Async await (again) (right way this time)
This commit is contained in:
parent
451b0af017
commit
6b52b27585
3 changed files with 8 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html scroll-behavior="smooth">
|
<html scroll-behavior="smooth">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="HandheldFriendly" content="true" />
|
<meta name="HandheldFriendly" content="true" />
|
||||||
<meta name="MobileOptimized" content="320" />
|
<meta name="MobileOptimized" content="320" />
|
||||||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width, user-scalable=no" />
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width, user-scalable=no" />
|
||||||
|
|
||||||
<!-- nunito font, copying wynndata -->
|
<!-- nunito font, copying wynndata -->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
|
||||||
|
|
4
load.js
4
load.js
|
@ -146,7 +146,9 @@ async function load_init(init_func) {
|
||||||
else {
|
else {
|
||||||
if (load_in_progress) {
|
if (load_in_progress) {
|
||||||
while (!load_complete) {
|
while (!load_complete) {
|
||||||
await sleep(100);
|
(async function () {
|
||||||
|
await sleep(100);
|
||||||
|
}) ()
|
||||||
}
|
}
|
||||||
init_func();
|
init_func();
|
||||||
}
|
}
|
||||||
|
|
6
load3.js
6
load3.js
|
@ -125,7 +125,7 @@ async function load(init_func) {
|
||||||
// DB not closed? idfk man
|
// DB not closed? idfk man
|
||||||
}
|
}
|
||||||
|
|
||||||
async function load_init(init_func) {
|
function load_init(init_func) {
|
||||||
if (load_complete) {
|
if (load_complete) {
|
||||||
console.log("Item db already loaded, skipping load sequence");
|
console.log("Item db already loaded, skipping load sequence");
|
||||||
init_func();
|
init_func();
|
||||||
|
@ -146,7 +146,9 @@ async function load_init(init_func) {
|
||||||
else {
|
else {
|
||||||
if (load_in_progress) {
|
if (load_in_progress) {
|
||||||
while (!load_complete) {
|
while (!load_complete) {
|
||||||
await sleep(100);
|
(async function () {
|
||||||
|
await sleep(100);
|
||||||
|
}) ()
|
||||||
}
|
}
|
||||||
init_func();
|
init_func();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue