tangled
alpha
login
or
join now
tjh.dev
/
test
forked from
tangled.org/core
0
fork
atom
Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork
atom
overview
issues
pulls
pipelines
appview: profile: limit events to 30
anirudh.fi
1 year ago
a70bcbc6
efb1ad66
verified
This commit was signed with the committer's
known signature
.
anirudh.fi
SSH Key Fingerprint:
SHA256:cz35vdbiWEzCNEfuL9fMC2JVIhtXavXBHrRjv8gxpAk=
+5
1 changed file
expand all
collapse all
unified
split
appview
db
profile.go
+5
appview/db/profile.go
···
15
15
16
16
func MakeProfileTimeline(e Execer, forDid string) ([]ProfileTimelineEvent, error) {
17
17
timeline := []ProfileTimelineEvent{}
18
18
+
limit := 30
18
19
19
20
pulls, err := GetPullsByOwnerDid(e, forDid)
20
21
if err != nil {
···
71
70
sort.Slice(timeline, func(i, j int) bool {
72
71
return timeline[i].EventAt.After(timeline[j].EventAt)
73
72
})
73
73
+
74
74
+
if len(timeline) > limit {
75
75
+
timeline = timeline[:limit]
76
76
+
}
74
77
75
78
return timeline, nil
76
79
}