Fix "Dashboard shows deleted comments" (#1995)
This commit is contained in:
parent
735676267e
commit
441986a473
8 changed files with 78 additions and 4 deletions
|
@ -54,7 +54,7 @@ func getDashboardContextUser(ctx *context.Context) *models.User {
|
|||
}
|
||||
|
||||
// retrieveFeeds loads feeds for the specified user
|
||||
func retrieveFeeds(ctx *context.Context, user *models.User, includePrivate, isProfile bool) {
|
||||
func retrieveFeeds(ctx *context.Context, user *models.User, includePrivate, isProfile bool, includeDeletedComments bool) {
|
||||
var requestingID int64
|
||||
if ctx.User != nil {
|
||||
requestingID = ctx.User.ID
|
||||
|
@ -64,6 +64,7 @@ func retrieveFeeds(ctx *context.Context, user *models.User, includePrivate, isPr
|
|||
RequestingUserID: requestingID,
|
||||
IncludePrivate: includePrivate,
|
||||
OnlyPerformedBy: isProfile,
|
||||
IncludeDeleted: includeDeletedComments,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetFeeds", err)
|
||||
|
@ -186,7 +187,7 @@ func Dashboard(ctx *context.Context) {
|
|||
ctx.Data["MirrorCount"] = len(mirrors)
|
||||
ctx.Data["Mirrors"] = mirrors
|
||||
|
||||
retrieveFeeds(ctx, ctxUser, true, false)
|
||||
retrieveFeeds(ctx, ctxUser, true, false, false)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ func Profile(ctx *context.Context) {
|
|||
ctx.Data["Keyword"] = keyword
|
||||
switch tab {
|
||||
case "activity":
|
||||
retrieveFeeds(ctx, ctxUser, showPrivate, true)
|
||||
retrieveFeeds(ctx, ctxUser, showPrivate, true, false)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue