mirror of
https://github.com/taigrr/teaqlite.git
synced 2026-04-02 04:59:03 -07:00
clear filter via esc
This commit is contained in:
@@ -18,6 +18,7 @@ const (
|
||||
// Custom message types
|
||||
type (
|
||||
SwitchToTableListMsg struct{}
|
||||
SwitchToTableListClearMsg struct{} // Switch to table list and clear any filter
|
||||
SwitchToTableDataMsg struct{ TableIndex int }
|
||||
SwitchToRowDetailMsg struct{ RowIndex int }
|
||||
SwitchToRowDetailFromQueryMsg struct{ RowIndex int }
|
||||
@@ -519,6 +520,14 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.currentView = NewTableListModel(m.getSharedData())
|
||||
return m, nil
|
||||
|
||||
case SwitchToTableListClearMsg:
|
||||
shared := m.getSharedData()
|
||||
// Clear any table filter
|
||||
shared.FilteredTables = make([]string, len(shared.Tables))
|
||||
copy(shared.FilteredTables, shared.Tables)
|
||||
m.currentView = NewTableListModel(shared)
|
||||
return m, nil
|
||||
|
||||
case SwitchToTableDataMsg:
|
||||
shared := m.getSharedData()
|
||||
shared.SelectedTable = msg.TableIndex
|
||||
|
||||
Reference in New Issue
Block a user