Skip to content

Commit 0ae967f

Browse files
committed
Condensed setState() ↞ [auto-sync from https://github.com/adamlui/youtube-classic]
1 parent 7ae0a5c commit 0ae967f

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

youtube-classic/youtube-classic.user.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes)
3-
// @version 2026.1.17.51
3+
// @version 2026.1.17.52
44
// @author Adam Lui, Magma_Craft, Anarios, JRWR, Fuim & hoothin
55
// @namespace https://github.com/adamlui
66
// @description Reverts YouTube to its classic design (before all the rounded corners & hidden dislikes) + redirects YouTube Shorts
@@ -1373,15 +1373,12 @@
13731373
function setState() {
13741374
cLog('Fetching votes...')
13751375
let statsSet = false
1376-
fetch(
1377-
`https://returnyoutubedislikeapi.com/votes?videoId=${getVideoID()}`
1378-
).then((response) => {
1379-
response.json().then((json) => {
1380-
if (json && !('traceId' in response) && !statsSet) {
1376+
fetch(`https://returnyoutubedislikeapi.com/votes?videoId=${getVideoID()}`).then(resp =>
1377+
resp.json().then(json => {
1378+
if (json && !('traceId' in resp) && !statsSet) {
13811379
const { dislikes, likes } = json
13821380
cLog(`Received count: ${dislikes}`)
1383-
likesVal = likes
1384-
dislikesVal = dislikes
1381+
likesVal = likes ; dislikesVal = dislikes
13851382
setDislikes(numberFormat(dislikes))
13861383
if (extConfig.numberDisplayReformatLikes) {
13871384
const nativeLikes = getLikeCntFromBtn()
@@ -1406,7 +1403,7 @@
14061403
}
14071404
}
14081405
})
1409-
})
1406+
)
14101407
}
14111408

14121409
function likeClicked() {

0 commit comments

Comments
 (0)