Skip to content

Commit 9165ea8

Browse files
authored
Only activity tab needs heatmap data loading (#34652)
1 parent 7a59f5a commit 9165ea8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

routers/web/user/profile.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,6 @@ func userProfile(ctx *context.Context) {
6363
ctx.Data["Title"] = ctx.ContextUser.DisplayName()
6464
ctx.Data["PageIsUserProfile"] = true
6565

66-
// prepare heatmap data
67-
if setting.Service.EnableUserHeatmap {
68-
data, err := activities_model.GetUserHeatmapDataByUser(ctx, ctx.ContextUser, ctx.Doer)
69-
if err != nil {
70-
ctx.ServerError("GetUserHeatmapDataByUser", err)
71-
return
72-
}
73-
ctx.Data["HeatmapData"] = data
74-
ctx.Data["HeatmapTotalContributions"] = activities_model.GetTotalContributionsInHeatmap(data)
75-
}
76-
7766
profileDbRepo, profileReadmeBlob := shared_user.FindOwnerProfileReadme(ctx, ctx.Doer)
7867

7968
prepareUserProfileTabData(ctx, profileDbRepo, profileReadmeBlob)
@@ -172,6 +161,17 @@ func prepareUserProfileTabData(ctx *context.Context, profileDbRepo *repo_model.R
172161
ctx.Data["Cards"] = following
173162
total = int(numFollowing)
174163
case "activity":
164+
// prepare heatmap data
165+
if setting.Service.EnableUserHeatmap {
166+
data, err := activities_model.GetUserHeatmapDataByUser(ctx, ctx.ContextUser, ctx.Doer)
167+
if err != nil {
168+
ctx.ServerError("GetUserHeatmapDataByUser", err)
169+
return
170+
}
171+
ctx.Data["HeatmapData"] = data
172+
ctx.Data["HeatmapTotalContributions"] = activities_model.GetTotalContributionsInHeatmap(data)
173+
}
174+
175175
date := ctx.FormString("date")
176176
pagingNum = setting.UI.FeedPagingNum
177177
showPrivate := ctx.IsSigned && (ctx.Doer.IsAdmin || ctx.Doer.ID == ctx.ContextUser.ID)

0 commit comments

Comments
 (0)