Fixed redeclaration error

Redeclaration error for theses variables: 'LIKED_STATE', 'DISLIKED_STATE', 'NEUTRAL_STATE' and 'storedData'
This commit is contained in:
Kalinka authored and GitHub committed 2021-12-10 18:23:14 +01:00
1 parent 99ffacb6b1
commit 72a43af882
1 file changed
+6 -5
@@ -1,9 +1,9 @@
const LIKED_STATE = "LIKED_STATE"; var LIKED_STATE = "LIKED_STATE";
const DISLIKED_STATE = "DISLIKED_STATE"; var DISLIKED_STATE = "DISLIKED_STATE";
const NEUTRAL_STATE = "NEUTRAL_STATE"; var NEUTRAL_STATE = "NEUTRAL_STATE";
if (!storedData) { if (!storedData) {
let storedData = { var storedData = {
likes: 0, likes: 0,
dislikes: 0, dislikes: 0,
previousState: NEUTRAL_STATE, previousState: NEUTRAL_STATE,
@@ -224,6 +224,7 @@ function numberFormat(numberState) {
} }
function setEventListeners(evt) { function setEventListeners(evt) {
let jsInitChecktimer;
function checkForJS_Finish() { function checkForJS_Finish() {
if (getButtons()?.offsetParent && isVideoLoaded()) { if (getButtons()?.offsetParent && isVideoLoaded()) {
clearInterval(jsInitChecktimer); clearInterval(jsInitChecktimer);
@@ -252,7 +253,7 @@ function setEventListeners(evt) {
} }
if (window.location.href.indexOf("watch?") >= 0) { if (window.location.href.indexOf("watch?") >= 0) {
let jsInitChecktimer = setInterval(checkForJS_Finish, 111); jsInitChecktimer = setInterval(checkForJS_Finish, 111);
} }
} }