diff --git a/cells/std/cli/main.go b/cells/std/cli/main.go index 3a425fb2..41744d6e 100644 --- a/cells/std/cli/main.go +++ b/cells/std/cli/main.go @@ -93,7 +93,11 @@ func (m *AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // This will also call our delegate's update function. if m.Focus == Left { m.Target, cmd = m.Target.Update(msg) - m.Action = NewAction(m.Target.List.SelectedItem().(item)) + if m.Target.List.SelectedItem() != nil { + m.Action = NewAction(m.Target.List.SelectedItem().(item)) + } else { + m.Action = &ActionModel{} + } cmds = append(cmds, cmd) } else { m.Action, cmd = m.Action.Update(msg) diff --git a/cells/std/cli/targets.go b/cells/std/cli/targets.go index 32768524..b9c530ca 100644 --- a/cells/std/cli/targets.go +++ b/cells/std/cli/targets.go @@ -23,14 +23,7 @@ type TargetModel struct { func (m *TargetModel) Init() tea.Cmd { return nil } func (m *TargetModel) Update(msg tea.Msg) (*TargetModel, tea.Cmd) { var cmd tea.Cmd - switch msg := msg.(type) { - case tea.KeyMsg: - switch msg.String() { - } - m.List, cmd = m.List.Update(msg) - return m, cmd - case tea.WindowSizeMsg: - } + m.List, cmd = m.List.Update(msg) return m, cmd } func (m *TargetModel) View() string {