mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 09:42:34 +02:00
Change paginator dots when no entry
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,12 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
if m.cursor >= len(m.findings) {
|
||||
m.cursor = max(0, len(m.findings)-1)
|
||||
}
|
||||
m.pager.SetTotalPages(len(m.findings))
|
||||
if len(m.findings) == 0 {
|
||||
m.pager.Page = 0
|
||||
m.pager.TotalPages = 0
|
||||
} else {
|
||||
m.pager.SetTotalPages(len(m.findings))
|
||||
}
|
||||
m.refreshListViewport()
|
||||
m.refreshBody()
|
||||
return m, nil
|
||||
|
||||
Reference in New Issue
Block a user