mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2025-09-07 13:20:40 +02:00
fix: preserve search filter after host operations
This commit is contained in:
parent
8f2837db78
commit
3a72694e5a
@ -70,7 +70,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
m.hosts = m.sortHosts(hosts)
|
m.hosts = m.sortHosts(hosts)
|
||||||
m.filteredHosts = m.hosts
|
|
||||||
|
// Reapply search filter if there is one active
|
||||||
|
if m.searchInput.Value() != "" {
|
||||||
|
m.filteredHosts = m.filterHosts(m.searchInput.Value())
|
||||||
|
} else {
|
||||||
|
m.filteredHosts = m.hosts
|
||||||
|
}
|
||||||
|
|
||||||
m.updateTableRows()
|
m.updateTableRows()
|
||||||
m.viewMode = ViewList
|
m.viewMode = ViewList
|
||||||
m.addForm = nil
|
m.addForm = nil
|
||||||
@ -107,7 +114,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
m.hosts = m.sortHosts(hosts)
|
m.hosts = m.sortHosts(hosts)
|
||||||
m.filteredHosts = m.hosts
|
|
||||||
|
// Reapply search filter if there is one active
|
||||||
|
if m.searchInput.Value() != "" {
|
||||||
|
m.filteredHosts = m.filterHosts(m.searchInput.Value())
|
||||||
|
} else {
|
||||||
|
m.filteredHosts = m.hosts
|
||||||
|
}
|
||||||
|
|
||||||
m.updateTableRows()
|
m.updateTableRows()
|
||||||
m.viewMode = ViewList
|
m.viewMode = ViewList
|
||||||
m.editForm = nil
|
m.editForm = nil
|
||||||
@ -234,7 +248,14 @@ func (m Model) handleListViewKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
|||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
m.hosts = m.sortHosts(hosts)
|
m.hosts = m.sortHosts(hosts)
|
||||||
m.filteredHosts = m.hosts
|
|
||||||
|
// Reapply search filter if there is one active
|
||||||
|
if m.searchInput.Value() != "" {
|
||||||
|
m.filteredHosts = m.filterHosts(m.searchInput.Value())
|
||||||
|
} else {
|
||||||
|
m.filteredHosts = m.hosts
|
||||||
|
}
|
||||||
|
|
||||||
m.updateTableRows()
|
m.updateTableRows()
|
||||||
m.deleteMode = false
|
m.deleteMode = false
|
||||||
m.deleteHost = ""
|
m.deleteHost = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user