tangled
alpha
login
or
join now
zan.dev
/
core
forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
0
fork
atom
overview
issues
pulls
pipelines
appview: profile: limit events to 30
anirudh.fi
11 months 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 {
···
70
71
sort.Slice(timeline, func(i, j int) bool {
71
72
return timeline[i].EventAt.After(timeline[j].EventAt)
72
73
})
74
74
+
75
75
+
if len(timeline) > limit {
76
76
+
timeline = timeline[:limit]
77
77
+
}
73
78
74
79
return timeline, nil
75
80
}