Fix index wraparound logic in News widget selection
This commit is contained in:
parent
9b5afc3d7c
commit
a29beeda43
@ -40,7 +40,7 @@ func createNewsOptions(ctx context.Context, _ terminalapi.Terminal, _ interface{
|
||||
return err
|
||||
}
|
||||
if len(widget.newsArticles.Articles) > 0 {
|
||||
widget.Selected = (widget.Selected + 1) % (len(widget.newsArticles.Articles) + 1)
|
||||
widget.Selected = (widget.Selected + 1) % len(widget.newsArticles.Articles)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user