From 75df6b96a17ce957c201a8841bc586f3258d786b Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 24 Aug 2020 21:09:28 -0400 Subject: [PATCH] Don't return the current frame in TickMsg --- spinner/spinner.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spinner/spinner.go b/spinner/spinner.go index 213eb9f..057cce8 100644 --- a/spinner/spinner.go +++ b/spinner/spinner.go @@ -110,8 +110,7 @@ func NewModel() Model { // TickMsg indicates that the timer has ticked and we should render a frame. type TickMsg struct { - Time time.Time - Frame string + Time time.Time } // Update is the Tea update function. This will advance the spinner one frame @@ -157,8 +156,7 @@ func View(model Model) string { func Tick(m Model) tea.Cmd { return tea.Tick(m.FPS, func(t time.Time) tea.Msg { return TickMsg{ - Time: t, - Frame: m.Frames[m.frame], + Time: t, } }) }