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, "DISCORD_USER": username,
"CUSTOM_STATUS": statusText, "CUSTOM_STATUS": statusText,
"LATEST_YOUTUBE": "filler", "LATEST_YOUTUBE": "filler",
"SPINCOUNT": globalSpins + 1 "SPINCOUNT": globalSpins
} }
var rpTable = Object.keys(replacers) var rpTable = Object.keys(replacers)

View file

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