mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 19:01:21 +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);
|
createRateBar(likesvalue, dislikesvalue);
|
||||||
previousState = 1;
|
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));
|
setDislikes(numberFormat(dislikesvalue));
|
||||||
createRateBar(likesvalue, dislikesvalue);
|
createRateBar(likesvalue, dislikesvalue);
|
||||||
previousState = 2;
|
previousState = 2;
|
||||||
|
if (extConfig.numberDisplayReformatLikes === true) {
|
||||||
|
const nativeLikes = getLikeCountFromButton();
|
||||||
|
if (nativeLikes !== false) {
|
||||||
|
setLikes(numberFormat(nativeLikes));
|
||||||
|
} else {
|
||||||
|
setLikes(numberFormat(storedData.likes));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
extConfig,
|
extConfig,
|
||||||
storedData,
|
storedData,
|
||||||
setLikes,
|
setLikes,
|
||||||
|
getLikeCountFromButton,
|
||||||
} from "./state";
|
} from "./state";
|
||||||
import { createRateBar } from "./bar";
|
import { createRateBar } from "./bar";
|
||||||
|
|
||||||
@@ -41,6 +42,14 @@ function likeClicked() {
|
|||||||
createRateBar(storedData.likes, storedData.dislikes);
|
createRateBar(storedData.likes, storedData.dislikes);
|
||||||
storedData.previousState = NEUTRAL_STATE;
|
storedData.previousState = NEUTRAL_STATE;
|
||||||
}
|
}
|
||||||
|
if (extConfig.numberDisplayReformatLikes === true) {
|
||||||
|
const nativeLikes = getLikeCountFromButton();
|
||||||
|
if (nativeLikes !== false) {
|
||||||
|
setLikes(numberFormat(nativeLikes));
|
||||||
|
} else {
|
||||||
|
setLikes(numberFormat(storedData.likes));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +74,14 @@ function dislikeClicked() {
|
|||||||
setDislikes(numberFormat(storedData.dislikes));
|
setDislikes(numberFormat(storedData.dislikes));
|
||||||
createRateBar(storedData.likes, storedData.dislikes);
|
createRateBar(storedData.likes, storedData.dislikes);
|
||||||
storedData.previousState = DISLIKED_STATE;
|
storedData.previousState = DISLIKED_STATE;
|
||||||
|
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