@@ -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 showPrivate := ctx .IsSigned && (ctx .Doer .IsAdmin || ctx .Doer .ID == ctx .ContextUser .ID )
@@ -173,6 +162,17 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
173162 ctx .Data ["Cards" ] = following
174163 total = int (numFollowing )
175164 case "activity" :
165+ // prepare heatmap data
166+ if setting .Service .EnableUserHeatmap {
167+ data , err := activities_model .GetUserHeatmapDataByUser (ctx , ctx .ContextUser , ctx .Doer )
168+ if err != nil {
169+ ctx .ServerError ("GetUserHeatmapDataByUser" , err )
170+ return
171+ }
172+ ctx .Data ["HeatmapData" ] = data
173+ ctx .Data ["HeatmapTotalContributions" ] = activities_model .GetTotalContributionsInHeatmap (data )
174+ }
175+
176176 date := ctx .FormString ("date" )
177177 pagingNum = setting .UI .FeedPagingNum
178178 items , count , err := feed_service .GetFeeds (ctx , activities_model.GetFeedsOptions {
0 commit comments