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.") } }