@@ -25,6 +25,7 @@ function allIncluded(outputTarget = 'email') {
25
25
let prsReviewDataProcessed = false ;
26
26
let showOpenLabel = true ;
27
27
let showClosedLabel = true ;
28
+ let showCommits = false ;
28
29
let userReason = '' ;
29
30
30
31
let pr_merged_button =
@@ -54,7 +55,8 @@ function allIncluded(outputTarget = 'email') {
54
55
'yesterdayContribution' ,
55
56
'userReason' ,
56
57
'githubCache' ,
57
- 'cacheInput'
58
+ 'cacheInput' ,
59
+ 'showCommits' ,
58
60
] ,
59
61
( items ) => {
60
62
console . log ( "Storage items received:" , items ) ;
@@ -120,6 +122,11 @@ function allIncluded(outputTarget = 'email') {
120
122
pr_merged_button = '' ;
121
123
issue_closed_button = '' ;
122
124
}
125
+ if ( items . showCommits !== undefined ) {
126
+ showCommits = items . showCommits ;
127
+ } else {
128
+ showCommits = false ; // Default value
129
+ }
123
130
if ( items . userReason ) {
124
131
userReason = items . userReason ;
125
132
}
@@ -771,7 +778,7 @@ ${userReason}`;
771
778
li = `<li><i>(${ project } )</i> - Made PR (#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ pr_merged_button } </li>` ;
772
779
} else if ( item . state === 'open' ) {
773
780
li = `<li><i>(${ project } )</i> - Made PR (#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ pr_unmerged_button } ` ;
774
- if ( item . _lastCommits && item . _lastCommits . length ) {
781
+ if ( showCommits && item . _lastCommits && item . _lastCommits . length ) {
775
782
item . _lastCommits . forEach ( commit => {
776
783
li += `<li style="list-style: disc; margin: 0 0 0 20px; padding: 0; color: #666;"><span style="color:#2563eb;">${ commit . messageHeadline } </span><span style="color:#666; font-size: 11px;"> (${ commit . author ?. user ?. login || commit . author ?. name || 'unknown' } , ${ new Date ( commit . committedDate ) . toLocaleString ( ) } )</span></li>` ;
777
784
} ) ;
@@ -902,6 +909,17 @@ ${userReason}`;
902
909
}
903
910
904
911
async function forceGithubDataRefresh ( ) {
912
+ let showCommits = false ;
913
+
914
+ await new Promise ( resolve => {
915
+ chrome . storage . local . get ( 'showCommits' , ( result ) => {
916
+ if ( result . showCommits !== undefined ) {
917
+ showCommits = result . showCommits ;
918
+ }
919
+ resolve ( ) ;
920
+ } ) ;
921
+ } ) ;
922
+
905
923
if ( typeof githubCache !== 'undefined' ) {
906
924
githubCache . data = null ;
907
925
githubCache . cacheKey = null ;
@@ -915,6 +933,8 @@ async function forceGithubDataRefresh() {
915
933
chrome . storage . local . remove ( 'githubCache' , resolve ) ;
916
934
} ) ;
917
935
936
+ chrome . storage . local . set ( { showCommits : showCommits } ) ;
937
+
918
938
hasInjectedContent = false ;
919
939
920
940
return { success : true } ;
0 commit comments