Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions internal/ui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,18 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg.String() {
case "esc", "enter":
m.setError(nil)
m.autoRefreshPaused = false

cmd := m.scheduleAutoRefresh()

if len(m.navigation) > 0 {
return m, tea.Batch(m.navigateBack(), cmd)
m.autoRefreshPaused = false
return m, tea.Batch(m.navigateBack(), m.scheduleAutoRefresh())
}

if m.loaded {
m.autoRefreshPaused = false
return m, m.scheduleAutoRefresh()
}

return m, cmd
return m, nil

case "ctrl+x":
return m, tea.Quit
Expand All @@ -218,10 +221,6 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}

m.autoRefreshPaused = true
m.autoRefreshGeneration++
m.autoRefreshScheduled = false

m.loading = false
m.showLoading = false
m.loadingLabel = ""
Expand All @@ -232,10 +231,6 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil

case resource.ErrorMsg:
m.autoRefreshPaused = true
m.autoRefreshGeneration++
m.autoRefreshScheduled = false

m.loading = false
m.showLoading = false
m.loadingLabel = ""
Expand Down
4 changes: 4 additions & 0 deletions internal/ui/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ func (m *Model) setError(err error) {
return
}

m.autoRefreshPaused = true
m.autoRefreshGeneration++
m.autoRefreshScheduled = false

m.resizeErrorViewport()
}

Expand Down
Loading