Fixed a misused setInterval()

In the commit that introduced `setInterval()` in `setupViewer()`
actually `setTimeout()` was intended.
This commit is contained in:
Veloman Yunkan
2022-09-24 19:33:44 +04:00
committed by Matthieu Gautier
parent 0dd638f261
commit ff192cba49
2 changed files with 5 additions and 2 deletions

View File

@ -384,7 +384,10 @@ function setupSuggestions() {
}
function setupViewer() {
setInterval(handle_visual_viewport_change, 0);
// Defer the call of handle_visual_viewport_change() until after the
// presence or absence of the taskbar as determined by this function
// has been settled.
setTimeout(handle_visual_viewport_change, 0);
const kiwixToolBarWrapper = document.getElementById('kiwixtoolbarwrapper');
if ( ! viewerSettings.toolbarEnabled ) {