diff --git a/bigbluebutton-html5/imports/utils/throttle.js b/bigbluebutton-html5/imports/utils/throttle.js index 9d0e12ab84..0ec52ed054 100644 --- a/bigbluebutton-html5/imports/utils/throttle.js +++ b/bigbluebutton-html5/imports/utils/throttle.js @@ -22,6 +22,10 @@ export function throttle(func, delay, options = {}) { if (leadingExec && leading) { execute(); leadingExec = false; + const nextExecDelay = elapsed < delay ? delay - elapsed : delay; + setTimeout(function () { + leadingExec = true; + }, nextExecDelay); } else if (!timeoutId && trailing) { timeoutId = setTimeout(function () { execute();