|
|
|
@ -782,12 +782,16 @@ func viewPullFiles(ctx *context.Context, beforeCommitID, afterCommitID string) {
|
|
|
|
// as the viewed information is designed to be loaded only on latest PR
|
|
|
|
// as the viewed information is designed to be loaded only on latest PR
|
|
|
|
// diff and if you're signed in.
|
|
|
|
// diff and if you're signed in.
|
|
|
|
var reviewState *pull_model.ReviewState
|
|
|
|
var reviewState *pull_model.ReviewState
|
|
|
|
|
|
|
|
var numViewedFiles int
|
|
|
|
if ctx.IsSigned && isShowAllCommits {
|
|
|
|
if ctx.IsSigned && isShowAllCommits {
|
|
|
|
reviewState, err = gitdiff.SyncUserSpecificDiff(ctx, ctx.Doer.ID, pull, gitRepo, diff, diffOptions)
|
|
|
|
reviewState, err = gitdiff.SyncUserSpecificDiff(ctx, ctx.Doer.ID, pull, gitRepo, diff, diffOptions)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
ctx.ServerError("SyncUserSpecificDiff", err)
|
|
|
|
ctx.ServerError("SyncUserSpecificDiff", err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if reviewState != nil {
|
|
|
|
|
|
|
|
numViewedFiles = reviewState.GetViewedFileCount()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
diffShortStat, err := gitdiff.GetDiffShortStat(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, beforeCommitID, afterCommitID)
|
|
|
|
diffShortStat, err := gitdiff.GetDiffShortStat(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, beforeCommitID, afterCommitID)
|
|
|
|
@ -796,10 +800,11 @@ func viewPullFiles(ctx *context.Context, beforeCommitID, afterCommitID string) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctx.Data["DiffShortStat"] = diffShortStat
|
|
|
|
ctx.Data["DiffShortStat"] = diffShortStat
|
|
|
|
|
|
|
|
ctx.Data["NumViewedFiles"] = numViewedFiles
|
|
|
|
|
|
|
|
|
|
|
|
ctx.PageData["prReview"] = map[string]any{
|
|
|
|
ctx.PageData["prReview"] = map[string]any{
|
|
|
|
"numberOfFiles": diffShortStat.NumFiles,
|
|
|
|
"numberOfFiles": diffShortStat.NumFiles,
|
|
|
|
"numberOfViewedFiles": diff.NumViewedFiles,
|
|
|
|
"numberOfViewedFiles": numViewedFiles,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err = diff.LoadComments(ctx, issue, ctx.Doer, ctx.Data["ShowOutdatedComments"].(bool)); err != nil {
|
|
|
|
if err = diff.LoadComments(ctx, issue, ctx.Doer, ctx.Data["ShowOutdatedComments"].(bool)); err != nil {
|
|
|
|
|