Skip to content

Commit

Permalink
fix:check whether the progressbar is visible before start the spinner…
Browse files Browse the repository at this point in the history
… change goroutine.
  • Loading branch information
chengxilo committed Sep 22, 2024
1 parent 12ba16a commit fbe274c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ func NewOptions64(max int64, options ...Option) *ProgressBar {
// if the render time interval attribute is set
if b.config.spinnerChangeInterval != 0 {
go func() {
if b.config.invisible {
return
}
ticker := time.NewTicker(b.config.spinnerChangeInterval)
defer ticker.Stop()
for {
Expand Down

0 comments on commit fbe274c

Please sign in to comment.