Merge pull request #19056 from ramonlsouza/throttle-fix-port
fix: Waiting room indicator sound defective
This commit is contained in:
commit
a8488ac841
@ -22,6 +22,10 @@ export function throttle(func, delay, options = {}) {
|
|||||||
if (leadingExec && leading) {
|
if (leadingExec && leading) {
|
||||||
execute();
|
execute();
|
||||||
leadingExec = false;
|
leadingExec = false;
|
||||||
|
const nextExecDelay = elapsed < delay ? delay - elapsed : delay;
|
||||||
|
setTimeout(function () {
|
||||||
|
leadingExec = true;
|
||||||
|
}, nextExecDelay);
|
||||||
} else if (!timeoutId && trailing) {
|
} else if (!timeoutId && trailing) {
|
||||||
timeoutId = setTimeout(function () {
|
timeoutId = setTimeout(function () {
|
||||||
execute();
|
execute();
|
||||||
|
Loading…
Reference in New Issue
Block a user