mirror of
https://github.com/charmbracelet/gum
synced 2024-06-08 16:52:17 +02:00
fix: spin timeout
This commit is contained in:
parent
65c4d53cae
commit
90f8a4aeae
|
@ -19,6 +19,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/charmbracelet/gum/internal/exit"
|
||||
"github.com/charmbracelet/gum/timeout"
|
||||
|
||||
"github.com/charmbracelet/bubbles/spinner"
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue