diff --git a/container_option.go b/container_option.go index 9fe67bf..a5df7ad 100644 --- a/container_option.go +++ b/container_option.go @@ -103,7 +103,7 @@ // Useful for testing purposes. func ForceAutoRefresh() ContainerOption { return func(s *pState) { - s.forceAutoRefresh = true + s.autoRefresh = true } } diff --git a/progress.go b/progress.go index 7d48596..4668044 100644 --- a/progress.go +++ b/progress.go @@ -45,7 +45,7 @@ reqWidth int popCompleted bool manualRefresh bool - forceAutoRefresh bool + autoRefresh bool renderDelay <-chan struct{} shutdownNotifier chan<- interface{} queueBars map[*Bar]*Bar @@ -87,11 +87,11 @@ go s.hm.run() cw := cwriter.New(s.output) - if (cw.IsTerminal() || s.forceAutoRefresh) && !s.manualRefresh { - s.forceAutoRefresh = true + if (cw.IsTerminal() || s.autoRefresh) && !s.manualRefresh { + s.autoRefresh = true go s.newTicker(s.renderDelay != nil) } else { - s.forceAutoRefresh = false + s.autoRefresh = false } p := &Progress{ @@ -250,7 +250,7 @@ } case <-p.done: update := make(chan bool) - for s.forceAutoRefresh && err == nil { + for s.autoRefresh && err == nil { s.hm.state(update) if <-update { err = render() @@ -391,7 +391,7 @@ total: total, filler: filler, refreshCh: s.refreshCh, - autoRefresh: s.forceAutoRefresh, + autoRefresh: s.autoRefresh, } if total > 0 {