chore: fix filter in TUI apps
a709a98c
3 file(s) · +14 −3
| 96 | 96 | return m.handleKey(msg) |
|
| 97 | 97 | } |
|
| 98 | 98 | ||
| 99 | - | return m, nil |
|
| 99 | + | var cmd tea.Cmd |
|
| 100 | + | switch m.state { |
|
| 101 | + | case stateBuckets: |
|
| 102 | + | m.bucketsList, cmd = m.bucketsList.Update(msg) |
|
| 103 | + | case stateBrowse: |
|
| 104 | + | m.browseList, cmd = m.browseList.Update(msg) |
|
| 105 | + | } |
|
| 106 | + | return m, cmd |
|
| 100 | 107 | } |
|
| 101 | 108 | ||
| 102 | 109 | func (m tuiModel) handleKey(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { |
| 92 | 92 | return m.handleKey(msg) |
|
| 93 | 93 | } |
|
| 94 | 94 | ||
| 95 | - | return m, nil |
|
| 95 | + | var cmd tea.Cmd |
|
| 96 | + | m.list, cmd = m.list.Update(msg) |
|
| 97 | + | return m, cmd |
|
| 96 | 98 | } |
|
| 97 | 99 | ||
| 98 | 100 | func (m Model) handleKey(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { |
| 89 | 89 | return m.handleKey(msg) |
|
| 90 | 90 | } |
|
| 91 | 91 | ||
| 92 | - | return m, nil |
|
| 92 | + | var cmd tea.Cmd |
|
| 93 | + | m.list, cmd = m.list.Update(msg) |
|
| 94 | + | return m, cmd |
|
| 93 | 95 | } |
|
| 94 | 96 | ||
| 95 | 97 | func (m Model) handleKey(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { |