formatted with prettier

This commit is contained in:
DARKDRAGON532 committed 2021-11-30 21:16:30 +05:30
1 parent ae1072ac67
commit cdb784e387
1 file changed
+11 -9
@@ -121,9 +121,9 @@ function setState() {
cLog("Fetching votes..."); cLog("Fetching votes...");
let statsSet = false; let statsSet = false;
fetch(`https://www.youtube.com/watch?v=${getVideoId()}`).then(response => { fetch(`https://www.youtube.com/watch?v=${getVideoId()}`).then((response) => {
response.text().then(text => { response.text().then((text) => {
let result = getDislikesFromYoutubeResponse(text) let result = getDislikesFromYoutubeResponse(text);
if (result) { if (result) {
cLog("response from youtube:"); cLog("response from youtube:");
cLog(JSON.stringify(result)); cLog(JSON.stringify(result));
@@ -134,19 +134,21 @@ function setState() {
statsSet = true; statsSet = true;
} }
} }
}) });
}) });
fetch(`https://return-youtube-dislike-api.azurewebsites.net/votes?videoId=${getVideoId()}`).then(response => { fetch(
response.json().then(json => { `https://return-youtube-dislike-api.azurewebsites.net/votes?videoId=${getVideoId()}`
).then((response) => {
response.json().then((json) => {
if (json && !statsSet) { if (json && !statsSet) {
const { dislikes, likes } = json; const { dislikes, likes } = json;
cLog(`Received count: ${dislikes}`); cLog(`Received count: ${dislikes}`);
setDislikes(numberFormat(dislikes)); setDislikes(numberFormat(dislikes));
createRateBar(likes, dislikes); createRateBar(likes, dislikes);
} }
}) });
}) });
} }
function likeClicked() { function likeClicked() {