From b691d7f07e25ca3cc20783f88b88a0bfc60fea6d Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 7 Sep 2021 13:41:00 -0400 Subject: [PATCH] Progress bars now statisfy the tea.Model interface --- progress/progress.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/progress/progress.go b/progress/progress.go index 6c35c8d..4b13910 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -176,11 +176,16 @@ func NewModel(opts ...Option) Model { return m } +// Init exists satisfy the tea.Model interface. +func (m Model) Init() tea.Cmd { + return nil +} + // Update is used to animation the progress bar during transitions. Use // SetPercent to create the command you'll need to trigger the animation. // // If you're rendering with ViewAs you won't need this. -func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { +func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case FrameMsg: if msg.id != m.id || msg.tag != m.tag {