Finally fixed the jitter

This commit is contained in:
bingus_violet 2024-04-22 07:56:44 -05:00
parent 93ce3204a7
commit 3b5945b326
2 changed files with 9 additions and 2 deletions

View file

@ -77,7 +77,7 @@ function converter(html, query) {
"DISCORD_USER": username,
"CUSTOM_STATUS": statusText,
"LATEST_YOUTUBE": "filler",
"SPINCOUNT": globalSpins + 1
"SPINCOUNT": globalSpins
}
var rpTable = Object.keys(replacers)

View file

@ -7,6 +7,8 @@ var sock
var spins = 1
var globalSpins = 0
var firsttimeDebounce = true
var spinWaiting = false
function spinLoop() {
@ -102,7 +104,12 @@ function socketeer() {
data = JSON.parse(data)
if (data.op == 4) {
globalSpins = data.spins
document.querySelector(".globalSpins").innerHTML = globalSpins;
if (firsttimeDebounce == true) {
firsttimeDebounce = false
document.querySelector(".globalSpins").innerHTML = globalSpins + 1;
} else {
document.querySelector(".globalSpins").innerHTML = globalSpins;
}
} else if (data.op == 0) {
var discFetch = await (await fetch("/discHTML")).text()
document.querySelector("#activityHTML").innerHTML = discFetch