mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 22:33:01 +01:00
move setInitialState to events.js
This commit is contained in:
1 parent
ed9a950d12
commit
4342f7e36f
2 files changed
+11
-8
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
isVideoLiked,
|
||||
getState,
|
||||
setState,
|
||||
setInitialState,
|
||||
setLikes,
|
||||
setDislikes,
|
||||
getLikeCountFromButton,
|
||||
@@ -27,13 +28,6 @@ let storedData = {
|
||||
previousState: NEUTRAL_STATE,
|
||||
};
|
||||
|
||||
function setInitialState() {
|
||||
setState(storedData);
|
||||
setTimeout(() => {
|
||||
sendVideoIds();
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
let jsInitChecktimer = null;
|
||||
|
||||
function setEventListeners(evt) {
|
||||
@@ -47,7 +41,7 @@ function setEventListeners(evt) {
|
||||
buttons.children[1].addEventListener("click", () => dislikeClicked(storedData));
|
||||
window.returnDislikeButtonlistenersSet = true;
|
||||
}
|
||||
setInitialState();
|
||||
setInitialState(storedData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { getLikeButton, getDislikeButton, getButtons } from "./buttons";
|
||||
import { createRateBar } from "./bar";
|
||||
import { getBrowser, getVideoId, cLog, numberFormat } from "./utils";
|
||||
import { sendVideoIds } from "./events";
|
||||
|
||||
const LIKED_STATE = "LIKED_STATE";
|
||||
const DISLIKED_STATE = "DISLIKED_STATE";
|
||||
@@ -96,12 +97,20 @@ function setState(storedData) {
|
||||
);
|
||||
}
|
||||
|
||||
function setInitialState(storedData) {
|
||||
setState(storedData);
|
||||
setTimeout(() => {
|
||||
sendVideoIds();
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
export {
|
||||
isMobile,
|
||||
isVideoDisliked,
|
||||
isVideoLiked,
|
||||
getState,
|
||||
setState,
|
||||
setInitialState,
|
||||
setLikes,
|
||||
setDislikes,
|
||||
getLikeCountFromButton,
|
||||
|
||||
Reference in new issue
Block a user