Skip to content

Commit

Permalink
Only tick if the ticker is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Aug 3, 2022
1 parent 20a857a commit 204272a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/progress_bar.rs
Expand Up @@ -201,7 +201,7 @@ impl ProgressBar {
pub fn inc(&self, delta: u64) {
self.pos.inc(delta);
let now = Instant::now();
if self.pos.allow(now) {
if self.pos.allow(now) && self.ticker.lock().unwrap().is_none() {
self.state().tick(now);
}
}
Expand Down Expand Up @@ -240,7 +240,7 @@ impl ProgressBar {
pub fn set_position(&self, pos: u64) {
self.pos.set(pos);
let now = Instant::now();
if self.pos.allow(now) {
if self.pos.allow(now) && self.ticker.lock().unwrap().is_none() {
self.state().tick(now);
}
}
Expand Down

0 comments on commit 204272a

Please sign in to comment.