Fix sleep gdi

This commit is contained in:
b 2021-06-19 00:06:50 -07:00
parent c8af5b4506
commit 485cffb302
4 changed files with 8 additions and 4 deletions

View file

@ -3,7 +3,7 @@ const url_tag = location.hash.slice(1);
// console.log(url_tag);
const BUILD_VERSION = "7.0.8";
const BUILD_VERSION = "7.0.9";
function setTitle() {
let text;

View file

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

View file

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

View file

@ -35,6 +35,10 @@ function clamp(num, low, high){
return Math.min(Math.max(num, low), high);
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
// Permutations in js reference (also cool algorithm):
// https://stackoverflow.com/a/41068709
function perm(a){
@ -372,4 +376,4 @@ async function hardReload() {
await dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) });
location.reload();
}
}