From c89d341651540cd26525afba7c43d45f31925ca8 Mon Sep 17 00:00:00 2001 From: RolimirKal Date: Thu, 30 Jul 2026 08:39:48 -0400 Subject: [PATCH] BugFix Changes: - Now pulls goal progress from correct object - Fixed incorrect acceptable animation range --- BookBar.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/BookBar.js b/BookBar.js index e62503a..6568a28 100644 --- a/BookBar.js +++ b/BookBar.js @@ -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}.`)