From 02cdfc98dd0180d186fba8e02f578207c4419c2c Mon Sep 17 00:00:00 2001 From: RolimirKal Date: Thu, 20 Aug 2026 20:16:00 -0400 Subject: [PATCH] Bug Fix Changes: - If an out of range update is received, set the current progress to zero or max to avoid getting stuck on the default value when the page is loaded after exceeding the goal. --- BookBar.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/BookBar.js b/BookBar.js index 652e5af..9217e17 100644 --- a/BookBar.js +++ b/BookBar.js @@ -41,8 +41,22 @@ class ProgressBar { && (val <= this.max_progress) && (val != this.current_progress)) { this.current_progress = val; - this.anim_progress = 0; + this.anim_progress = 0; } else { + if (Number.isInteger(val) + && (val >= this.max_progress) + && (val != this.current_progress)) { + this.current_progress = this.max_progress; + this.anim_progress = 0; + console.warn("Progress update: Goal Exceeded.") + } + if (Number.isInteger(val) + && (val <= 0) + && (val != this.current_progress)) { + this.current_progress = 0; + this.anim_progress = 0; + console.warn("Progress update: Goal Subceeded.") + } console.warn("Progress update failed.") } }