Skip to content

Commit

Permalink
fix: set length to unknown if set to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand committed Nov 7, 2024
1 parent dcad234 commit 9151851
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,11 @@ func (p *ProgressBar) ChangeMax64(newMax int64) {
p.config.useIECUnits)
}

p.lengthKnown(newMax)
if newMax == -1 {
p.lengthUnknown()
} else {
p.lengthKnown(newMax)
}
p.lock.Unlock() // so p.Add can lock

p.Add(0) // re-render
Expand Down

0 comments on commit 9151851

Please # to comment.