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.
This commit is contained in:
2026-08-20 20:16:00 -04:00
parent bf578cf830
commit 02cdfc98dd
+14
View File
@@ -43,6 +43,20 @@ class ProgressBar {
this.current_progress = val;
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.")
}
}