Skip to content

Commit

Permalink
WIP: fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Apr 15, 2022
1 parent 3ada194 commit 37c9992
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 5 additions & 1 deletion cells/std/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 1 addition & 8 deletions cells/std/cli/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 37c9992

Please sign in to comment.