diff --git a/web/src/app/js/base.js b/web/src/app/js/base.js index f6e0cd5..12ae317 100644 --- a/web/src/app/js/base.js +++ b/web/src/app/js/base.js @@ -236,12 +236,13 @@ function getNormalizedURI() { return window.location.pathname.replace(/\/+?$/, ' function capitalize(s) { return s.charAt(0).toUpperCase() + s.substr(1) } function randomNum(min, max) { return Math.floor(Math.random() * (max - min) + min) } function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)) } -async function waitUntil(cback, secs) { +async function waitUntil(cback, ticks, ts) { + ts = ts || 1000; var i = 0; - while (i < secs) { + while (i < ticks) { if (cback()) return; - await sleep(1000); + await sleep(ts); i++; } }