+11
appview/db/star.go
+11
appview/db/star.go
···
5
"errors"
6
"fmt"
7
"log"
8
+
"slices"
9
"strings"
10
"time"
11
···
209
for _, s := range starMap {
210
stars = append(stars, s...)
211
}
212
+
213
+
slices.SortFunc(stars, func(a, b models.Star) int {
214
+
if a.Created.After(b.Created) {
215
+
return -1
216
+
}
217
+
if b.Created.After(a.Created) {
218
+
return 1
219
+
}
220
+
return 0
221
+
})
222
223
return stars, nil
224
}
+4
-13
appview/state/profile.go
+4
-13
appview/state/profile.go
···
217
s.pages.Error500(w)
218
return
219
}
220
-
var repoAts []string
221
for _, s := range stars {
222
-
repoAts = append(repoAts, string(s.RepoAt))
223
-
}
224
-
225
-
repos, err := db.GetRepos(
226
-
s.db,
227
-
0,
228
-
db.FilterIn("at_uri", repoAts),
229
-
)
230
-
if err != nil {
231
-
l.Error("failed to get repos", "err", err)
232
-
s.pages.Error500(w)
233
-
return
234
}
235
236
err = s.pages.ProfileStarred(w, pages.ProfileStarredParams{