|
@@ -203,10 +203,10 @@ function getLikeCountFromButton() {
|
|
|
if (isShorts()) {
|
|
|
//Youtube Shorts don't work with this query. It's not nessecary; we can skip it and still see the results.
|
|
|
//It should be possible to fix this function, but it's not critical to showing the dislike count.
|
|
|
- return 0;
|
|
|
+ return false;
|
|
|
}
|
|
|
let likesStr = getLikeButton()
|
|
|
- .querySelector("button")
|
|
|
+ .querySelector("yt-formatted-string#text")
|
|
|
.getAttribute("aria-label")
|
|
|
.replace(/\D/g, "");
|
|
|
return likesStr.length > 0 ? parseInt(likesStr) : false;
|
|
@@ -376,8 +376,6 @@ function likeClicked() {
|
|
|
const nativeLikes = getLikeCountFromButton();
|
|
|
if (nativeLikes !== false) {
|
|
|
setLikes(numberFormat(nativeLikes));
|
|
|
- } else {
|
|
|
- setLikes(numberFormat(storedData.likes));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -405,8 +403,6 @@ function dislikeClicked() {
|
|
|
const nativeLikes = getLikeCountFromButton();
|
|
|
if (nativeLikes !== false) {
|
|
|
setLikes(numberFormat(nativeLikes));
|
|
|
- } else {
|
|
|
- setLikes(numberFormat(storedData.likes));
|
|
|
}
|
|
|
}
|
|
|
}
|