@@ -578,17 +578,9 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
578
578
// -------------------------------
579
579
// Fill stats to post to ctx.Data.
580
580
// -------------------------------
581
- issueStats , err := getUserIssueStats (ctx , filterMode , issue_indexer .ToSearchOptions (keyword , opts ).Copy (
581
+ issueStats , err := getUserIssueStats (ctx , ctxUser , filterMode , issue_indexer .ToSearchOptions (keyword , opts ).Copy (
582
582
func (o * issue_indexer.SearchOptions ) {
583
583
o .IsFuzzyKeyword = isFuzzy
584
- // If the doer is the same as the context user, which means the doer is viewing his own dashboard,
585
- // it's not enough to show the repos that the doer owns or has been explicitly granted access to,
586
- // because the doer may create issues or be mentioned in any public repo.
587
- // So we need search issues in all public repos.
588
- o .AllPublic = ctx .Doer .ID == ctxUser .ID
589
- o .MentionID = nil
590
- o .ReviewRequestedID = nil
591
- o .ReviewedID = nil
592
584
},
593
585
))
594
586
if err != nil {
@@ -777,10 +769,19 @@ func UsernameSubRoute(ctx *context.Context) {
777
769
}
778
770
}
779
771
780
- func getUserIssueStats (ctx * context.Context , filterMode int , opts * issue_indexer.SearchOptions ) (ret * issues_model.IssueStats , err error ) {
772
+ func getUserIssueStats (ctx * context.Context , ctxUser * user_model. User , filterMode int , opts * issue_indexer.SearchOptions ) (ret * issues_model.IssueStats , err error ) {
781
773
ret = & issues_model.IssueStats {}
782
774
doerID := ctx .Doer .ID
783
775
776
+ opts = opts .Copy (func (o * issue_indexer.SearchOptions ) {
777
+ // If the doer is the same as the context user, which means the doer is viewing his own dashboard,
778
+ // it's not enough to show the repos that the doer owns or has been explicitly granted access to,
779
+ // because the doer may create issues or be mentioned in any public repo.
780
+ // So we need search issues in all public repos.
781
+ o .AllPublic = doerID == ctxUser .ID
782
+ })
783
+
784
+ // Open/Closed are for the tabs of the issue list
784
785
{
785
786
openClosedOpts := opts .Copy ()
786
787
switch filterMode {
@@ -811,6 +812,15 @@ func getUserIssueStats(ctx *context.Context, filterMode int, opts *issue_indexer
811
812
}
812
813
}
813
814
815
+ // Below stats are for the left sidebar
816
+ opts = opts .Copy (func (o * issue_indexer.SearchOptions ) {
817
+ o .AssigneeID = nil
818
+ o .PosterID = nil
819
+ o .MentionID = nil
820
+ o .ReviewRequestedID = nil
821
+ o .ReviewedID = nil
822
+ })
823
+
814
824
ret .YourRepositoriesCount , err = issue_indexer .CountIssues (ctx , opts .Copy (func (o * issue_indexer.SearchOptions ) { o .AllPublic = false }))
815
825
if err != nil {
816
826
return nil , err
0 commit comments