@@ -59,11 +59,11 @@ func getDashboardContextUser(ctx *context.Context) *models.User {
59
59
}
60
60
61
61
// retrieveFeeds loads feeds for the specified user
62
- func retrieveFeeds (ctx * context.Context , options models.GetFeedsOptions ) {
62
+ func retrieveFeeds (ctx * context.Context , options models.GetFeedsOptions ) [] * models. Action {
63
63
actions , err := models .GetFeeds (options )
64
64
if err != nil {
65
65
ctx .ServerError ("GetFeeds" , err )
66
- return
66
+ return nil
67
67
}
68
68
69
69
userCache := map [int64 ]* models.User {options .RequestedUser .ID : options .RequestedUser }
@@ -85,13 +85,13 @@ func retrieveFeeds(ctx *context.Context, options models.GetFeedsOptions) {
85
85
continue
86
86
}
87
87
ctx .ServerError ("GetUserByID" , err )
88
- return
88
+ return nil
89
89
}
90
90
userCache [repoOwner .ID ] = repoOwner
91
91
}
92
92
act .Repo .Owner = repoOwner
93
93
}
94
- ctx . Data [ "Feeds" ] = actions
94
+ return actions
95
95
}
96
96
97
97
// Dashboard render the dashboard page
@@ -149,7 +149,7 @@ func Dashboard(ctx *context.Context) {
149
149
ctx .Data ["MirrorCount" ] = len (mirrors )
150
150
ctx .Data ["Mirrors" ] = mirrors
151
151
152
- retrieveFeeds (ctx , models.GetFeedsOptions {
152
+ actions := retrieveFeeds (ctx , models.GetFeedsOptions {
153
153
RequestedUser : ctxUser ,
154
154
RequestedTeam : ctx .Org .Team ,
155
155
Actor : ctx .User ,
@@ -158,10 +158,11 @@ func Dashboard(ctx *context.Context) {
158
158
IncludeDeleted : false ,
159
159
Date : ctx .Query ("date" ),
160
160
})
161
-
162
161
if ctx .Written () {
163
162
return
164
163
}
164
+ ctx .Data ["Feeds" ] = actions
165
+
165
166
ctx .HTML (http .StatusOK , tplDashboard )
166
167
}
167
168
0 commit comments