return early empty issue list if no issues found
This commit is contained in:
@@ -76,16 +76,15 @@ func renderHeaders(cols []TableColumn) string {
|
|||||||
|
|
||||||
func NewIssueList(svc *service.Services, width, height int) IssueList {
|
func NewIssueList(svc *service.Services, width, height int) IssueList {
|
||||||
issues, err := svc.Beads.AllIssues(context.Background())
|
issues, err := svc.Beads.AllIssues(context.Background())
|
||||||
|
if err != nil {
|
||||||
|
return IssueList{}
|
||||||
|
}
|
||||||
|
|
||||||
listIssues := []ListIssue{}
|
listIssues := []ListIssue{}
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
listIssues = append(listIssues, ListIssue{Issue: issue})
|
listIssues = append(listIssues, ListIssue{Issue: issue})
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
listIssues = []ListIssue{}
|
|
||||||
}
|
|
||||||
|
|
||||||
items := make([]list.Item, len(listIssues))
|
items := make([]list.Item, len(listIssues))
|
||||||
for i, issue := range listIssues {
|
for i, issue := range listIssues {
|
||||||
items[i] = issue
|
items[i] = issue
|
||||||
|
|||||||
Reference in New Issue
Block a user