sort global by created, not updated
This commit is contained in:
parent
e0e7ebfa28
commit
5437b6cf09
1
.nanpa/smile-envoy-void.kdl
Normal file
1
.nanpa/smile-envoy-void.kdl
Normal file
@ -0,0 +1 @@
|
||||
patch type="fixed" "sort global feels by creation time"
|
||||
@ -202,10 +202,10 @@ func GetPostsForUser(user string) (posts []Post) {
|
||||
}
|
||||
|
||||
// SortUsersByRecent sorts posts, putting the posts that were most recently
|
||||
// edited first in the list.
|
||||
// created first in the list. it used to be recently edited why'd i do that
|
||||
func SortPostsByRecent(posts []Post) []Post {
|
||||
sort.Slice(posts, func(i, j int) bool {
|
||||
return posts[i].LastEdited.After(posts[j].LastEdited)
|
||||
return posts[i].Date.After(posts[j].Date)
|
||||
})
|
||||
return posts
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user