diff --git a/tui/inbox.go b/tui/inbox.go index 5abfee614e3362a5370271213fceb4dc659cdf36..f470a6eb818c00d8ea85c6fc2fe603312419ea2e 100644 --- a/tui/inbox.go +++ b/tui/inbox.go @@ -136,6 +136,15 @@ func (m *Inbox) Update(msg tea.Msg) (tea.Model, tea.Cmd) { }) } + // New logic to fetch more emails when filtering is active + if m.list.FilterState() == list.Filtering && !m.isFetching { + m.isFetching = true + m.list.Title = "Fetching more emails..." + cmds = append(cmds, func() tea.Msg { + return FetchMoreEmailsMsg{Offset: uint32(m.emailsCount)} + }) + } + var cmd tea.Cmd var newModel list.Model newModel, cmd = m.list.Update(msg)