Skip to content

Commit

Permalink
fix: spin timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Jun 30, 2023
1 parent 65c4d53 commit 90f8a4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spin/spin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"strings"
"time"

"github.com/charmbracelet/gum/internal/exit"
"github.com/charmbracelet/gum/timeout"

"github.com/charmbracelet/bubbles/spinner"
Expand Down Expand Up @@ -86,7 +87,7 @@ func (m model) View() string {
}
var header string
if m.align == "left" {
header = m.spinner.View() + " " + m.title + str
header = m.spinner.View() + str + " " + m.title
} else {
header = str + " " + m.title + " " + m.spinner.View()
}
Expand All @@ -101,7 +102,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case timeout.TickTimeoutMsg:
if msg.TimeoutValue <= 0 {
m.status = 130
m.status = exit.StatusAborted
return m, tea.Quit
}
m.timeout = msg.TimeoutValue
Expand Down

0 comments on commit 90f8a4a

Please sign in to comment.