Changes:
- Now pulls goal progress from correct object
- Fixed incorrect acceptable animation range
This commit is contained in:
2026-07-30 08:39:48 -04:00
parent 72fe8d1abb
commit c89d341651
+6 -8
View File
@@ -71,8 +71,8 @@ class ProgressBar {
//Increment the animation ticker (plus an extra round of safety checks)
if ((new_val >= 0)
&& (new_val <= this.current_progress)
&& (this.anim_progress < this.max_progress)
&& (new_val < this.max_progress)) {
&& (this.anim_progress <= this.max_progress)
&& (new_val <= this.max_progress)) {
this.anim_progress = new_val;
}
else {
@@ -233,8 +233,6 @@ function communicate(websocket, book_bar) {
const params = new URLSearchParams(window.location.search);
// INITIALIZE CLASS HERE
book_bar.animStart();
//setTimeout(() => book_bar.animEnd(), 30000);
//book_bar.simStart();
websocket.onopen = () => {
websocket.send(
@@ -259,16 +257,16 @@ function communicate(websocket, book_bar) {
switch (event.method) {
case "setTimer":
//do something with the new data
console.log("set timer: " + event);
book_bar.setProgress(event.reward_progress);
console.log("set timer: " + args.reward_progress);
book_bar.setProgress(args.reward_progress);
break;
case "noTimer":
//do something default
console.log("no timer: " + event);
console.log("no timer: " + args);
break;
case "endTimer":
//do something for the final time
console.log("end timer: " + event);
console.log("end timer: " + args);
break
default:
throw new Error(`Unsupported method requested: ${event.method}.`)