fix(progress): update progress bar threshold method per changes in d897463

This commit is contained in:
Christian Rocha 2022-03-31 15:11:23 -04:00
parent 00d61decf4
commit 6d6149cea8
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018

View File

@ -251,8 +251,8 @@ func (m Model) Percent() float64 {
// If you're rendering with ViewAs you won't need this. // If you're rendering with ViewAs you won't need this.
func (m *Model) SetPercent(p float64) tea.Cmd { func (m *Model) SetPercent(p float64) tea.Cmd {
// If the value is at or below the animation threshold, don't animate // If the value is at or below the animation threshold, don't animate
if math.Abs(p-m.percent) <= m.animThreshold { if math.Abs(p-m.percentShown) <= m.animThreshold {
m.percent = asRatio(p) m.percentShown = asRatio(p)
m.targetPercent = asRatio(p) m.targetPercent = asRatio(p)
return nil return nil
} }