mirror of
https://github.com/glanceapp/glance.git
synced 2025-07-16 06:25:06 +02:00
Move engagement calculation inside widget
This commit is contained in:
@ -110,7 +110,5 @@ func FetchSubredditPosts(subreddit, sort, topPeriod, search, commentsUrlTemplate
|
||||
posts = append(posts, forumPost)
|
||||
}
|
||||
|
||||
posts.CalculateEngagement()
|
||||
|
||||
return posts, nil
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ func (widget *Reddit) Update(ctx context.Context) {
|
||||
}
|
||||
|
||||
if widget.ExtraSortBy == "engagement" {
|
||||
posts.CalculateEngagement()
|
||||
posts.SortByEngagement()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user