fix: spinners spin too fast
This commit is contained in:
parent
539835627b
commit
a70ed5a372
2 changed files with 3 additions and 3 deletions
|
|
@ -79,7 +79,7 @@ func (m RetrieveModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
if msg.String() == "enter" {
|
if msg.String() == "enter" {
|
||||||
m.loading = true
|
m.loading = true
|
||||||
m.records = nil
|
m.records = nil
|
||||||
return m, retrieveRecords(m.client, m.textinput.Value())
|
return m, tea.Batch(retrieveRecords(m.client, m.textinput.Value()), m.spinner.Tick)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(m.records) > 0 {
|
if len(m.records) > 0 {
|
||||||
|
|
@ -107,7 +107,7 @@ func (m RetrieveModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
|
|
||||||
if m.loading {
|
if m.loading {
|
||||||
m.spinner, cmd = m.spinner.Update(msg)
|
m.spinner, cmd = m.spinner.Update(msg)
|
||||||
return m, tea.Batch(cmd, m.spinner.Tick)
|
return m, cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
return m, textinput.Blink
|
return m, textinput.Blink
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
|
|
||||||
if m.loading {
|
if m.loading {
|
||||||
m.spinner, cmd = m.spinner.Update(msg)
|
m.spinner, cmd = m.spinner.Update(msg)
|
||||||
return m, tea.Batch(cmd, m.spinner.Tick)
|
return m, cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
return m, nil
|
return m, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue