mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-23 06:43:02 +01:00
Update like number when like/dislike button is clicked
When like button is clicked, YT will update like count. This conflicts with user option "re-format like numbers". Force update like number. attn #561 #584
This commit is contained in:
1 parent
df742d0566
commit
260798d1a8
2 files changed
+33
No files matched your search
@@ -372,6 +372,14 @@ function likeClicked() {
|
||||
createRateBar(likesvalue, dislikesvalue);
|
||||
previousState = 1;
|
||||
}
|
||||
if (extConfig.numberDisplayReformatLikes === true) {
|
||||
const nativeLikes = getLikeCountFromButton();
|
||||
if (nativeLikes !== false) {
|
||||
setLikes(numberFormat(nativeLikes));
|
||||
} else {
|
||||
setLikes(numberFormat(storedData.likes));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,6 +401,14 @@ function dislikeClicked() {
|
||||
setDislikes(numberFormat(dislikesvalue));
|
||||
createRateBar(likesvalue, dislikesvalue);
|
||||
previousState = 2;
|
||||
if (extConfig.numberDisplayReformatLikes === true) {
|
||||
const nativeLikes = getLikeCountFromButton();
|
||||
if (nativeLikes !== false) {
|
||||
setLikes(numberFormat(nativeLikes));
|
||||
} else {
|
||||
setLikes(numberFormat(storedData.likes));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user