Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions internal/tui/views/trafficwatch/left_pane.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ func (l *LeftPane) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

var cmd tea.Cmd
if val, ok := msg.(tea.KeyMsg); ok && val.String() == "left" {
return l, nil
}
l.paginator, cmd = l.paginator.Update(msg)
return l, cmd
}
Expand Down
15 changes: 6 additions & 9 deletions internal/tui/views/trafficwatch/main_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,22 +335,19 @@ func (m *MainView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

// Update focused pane
var cmd tea.Cmd
if m.state == StateWithData {
m.rightPane.SetFocused(m.focus == "right")

switch m.focus {
case "left":
_, cmd = m.leftPane.Update(msg)
case "right":
_, cmd = m.rightPane.Update(msg)
}
_, cmd := m.leftPane.Update(msg)
cmds = append(cmds, cmd)

_, cmd = m.rightPane.Update(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need an cmds = append(cmds, cmd) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 276549b

}

if m.state == StateLogs {
_, cmd = m.logsView.Update(msg)
_, cmd := m.logsView.Update(msg)
cmds = append(cmds, cmd)
}
cmds = append(cmds, cmd)

return m, tea.Batch(cmds...)
}
Expand Down