Fixed global declaration error

Variable 'jsInitChecktimer' wasn't declared globally, so it was causing a problem with the new declaration 'let' (instead of 'var' for a better compliance with ES2015 standards).
This commit is contained in:
Kalinka authored and GitHub committed 2021-12-10 17:22:13 +01:00
1 parent 2e7958ee76
commit d917142772
1 file changed
+3 -1
@@ -404,6 +404,8 @@ function getDislikesFromYoutubeResponse(htmlResponse) {
} }
function setEventListeners(evt) { function setEventListeners(evt) {
let jsInitChecktimer;
function checkForJS_Finish(check) { function checkForJS_Finish(check) {
console.log(); console.log();
if (getButtons()?.offsetParent && isVideoLoaded()) { if (getButtons()?.offsetParent && isVideoLoaded()) {
@@ -425,7 +427,7 @@ function setEventListeners(evt) {
(isMobile && evt?.indexOf("watch?") >= 0) (isMobile && evt?.indexOf("watch?") >= 0)
) { ) {
cLog("Setting up..."); cLog("Setting up...");
let jsInitChecktimer = setInterval(checkForJS_Finish, 111); jsInitChecktimer = setInterval(checkForJS_Finish, 111);
} }
} }