diff --git a/bigbluebutton-html5/imports/utils/throttle.js b/bigbluebutton-html5/imports/utils/throttle.js index 9d0e12ab84..0eaead6847 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 : 0; + setTimeout(function () { + leadingExec = true; + }, nextExecDelay); } else if (!timeoutId && trailing) { timeoutId = setTimeout(function () { execute();