Skip to content

Commit

Permalink
fix: error on marking empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
guyfedwards committed Mar 8, 2024
1 parent 719f5d9 commit 06dfae4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/commands/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ func updateList(msg tea.Msg, m model) (tea.Model, tea.Cmd) {
break
}

if len(m.list.Items()) == 0 {
return m, m.list.NewStatusMessage("No items to mark.")
}

current := m.list.SelectedItem().(TUIItem)
err := m.commands.store.ToggleRead(current.ID)
if err != nil {
Expand Down

0 comments on commit 06dfae4

Please sign in to comment.