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:
parent
c8a14e7685
commit
307d8aead0
@ -44,10 +44,16 @@ func (widget *Widget) Refresh() {
|
|||||||
widget.links = nil
|
widget.links = nil
|
||||||
widget.SetItemCount(0)
|
widget.SetItemCount(0)
|
||||||
} else {
|
} else {
|
||||||
|
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.links = links[:widget.settings.numberOfPosts]
|
||||||
widget.SetItemCount(len(widget.links))
|
widget.SetItemCount(len(widget.links))
|
||||||
widget.err = nil
|
widget.err = nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
widget.Render()
|
widget.Render()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user