From 6d6149cea826bc19fb48cb35c6dcbeb4fa355ff1 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Thu, 31 Mar 2022 15:11:23 -0400 Subject: [PATCH] fix(progress): update progress bar threshold method per changes in d897463 --- progress/progress.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/progress/progress.go b/progress/progress.go index 60de488..ac37a94 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -251,8 +251,8 @@ func (m Model) Percent() float64 { // If you're rendering with ViewAs you won't need this. func (m *Model) SetPercent(p float64) tea.Cmd { // If the value is at or below the animation threshold, don't animate - if math.Abs(p-m.percent) <= m.animThreshold { - m.percent = asRatio(p) + if math.Abs(p-m.percentShown) <= m.animThreshold { + m.percentShown = asRatio(p) m.targetPercent = asRatio(p) return nil }