Finally fixed the jitter
This commit is contained in:
parent
93ce3204a7
commit
3b5945b326
2 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue