Fix sleep gdi
This commit is contained in:
parent
c8af5b4506
commit
485cffb302
4 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||
|
|
2
load.js
2
load.js
|
@ -146,7 +146,7 @@ function load_init(init_func) {
|
|||
else {
|
||||
if (load_in_progress) {
|
||||
while (!load_complete) {
|
||||
sleep(100);
|
||||
await sleep(100);
|
||||
}
|
||||
init_func();
|
||||
}
|
||||
|
|
2
load3.js
2
load3.js
|
@ -146,7 +146,7 @@ function load_init(init_func) {
|
|||
else {
|
||||
if (load_in_progress) {
|
||||
while (!load_complete) {
|
||||
sleep(100);
|
||||
await sleep(100);
|
||||
}
|
||||
init_func();
|
||||
}
|
||||
|
|
6
utils.js
6
utils.js
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue