@@ -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