mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Convert the bulk of modules over to RedrawFunc
This commit is contained in:
@@ -67,10 +67,6 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
// Render sets up the widget data for redrawing to the screen
|
||||
func (widget *Widget) Render() {
|
||||
if widget.stories == nil {
|
||||
return
|
||||
}
|
||||
|
||||
widget.RedrawFunc(widget.content)
|
||||
}
|
||||
|
||||
@@ -79,6 +75,9 @@ func (widget *Widget) Render() {
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
title := fmt.Sprintf("%s - %s stories", widget.CommonSettings().Title, widget.settings.storyType)
|
||||
stories := widget.stories
|
||||
if stories == nil || len(stories) == 0 {
|
||||
return title, "No stories to display", false
|
||||
}
|
||||
var str string
|
||||
|
||||
for idx, story := range stories {
|
||||
|
||||
Reference in New Issue
Block a user