Skip to content

Commit

Permalink
fix(spin): clear title after finished (#815)
Browse files Browse the repository at this point in the history
closes #802

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 authored Jan 22, 2025
1 parent 05c4bb9 commit 2da9527
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spin/spin.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ func (m model) Init() tea.Cmd {
}

func (m model) View() string {
if !m.isTTY {
return m.title
}

var out string
if m.showStderr {
out += errbuf.String()
Expand All @@ -115,10 +111,14 @@ func (m model) View() string {
out += outbuf.String()
}

if m.quitting && out != "" {
if m.quitting {
return out
}

if !m.isTTY {
return m.title
}

var header string
if m.align == "left" {
header = m.spinner.View() + " " + m.title
Expand Down

0 comments on commit 2da9527

Please sign in to comment.