1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

add a case where subreddit link length is less than widet.settings.numberOfPosts (#754)

This commit is contained in:
TDHTTTT 2019-11-16 19:53:52 -08:00 committed by Chris Cummer
parent c8a14e7685
commit 307d8aead0

View File

@ -44,10 +44,16 @@ func (widget *Widget) Refresh() {
widget.links = nil
widget.SetItemCount(0)
} else {
widget.links = links[:widget.settings.numberOfPosts]
widget.SetItemCount(len(widget.links))
widget.err = nil
}
if len(links) <= widget.settings.numberOfPosts {
widget.links = links
widget.SetItemCount(len(widget.links))
widget.err = nil
} else {
widget.links = links[:widget.settings.numberOfPosts]
widget.SetItemCount(len(widget.links))
widget.err = nil
}
}
widget.Render()
}