1
+ const DEBUG = false ;
2
+ function log ( ...args ) {
3
+ if ( DEBUG ) {
4
+ console . log ( `[SCRUM-HELPER]:` , ...args ) ;
5
+ }
6
+ }
7
+ function logError ( ...args ) {
8
+ if ( DEBUG ) {
9
+ console . error ( '[SCRUM-HELPER]:' , ...args ) ;
10
+ }
11
+ }
1
12
console . log ( 'Script loaded, adapter exists:' , ! ! window . emailClientAdapter ) ;
2
13
let refreshButton_Placed = false ;
3
14
let enableToggle = true ;
4
15
let hasInjectedContent = false ;
5
16
let scrumGenerationInProgress = false ;
6
17
let orgName = 'fossasia' ; // default
7
18
function allIncluded ( outputTarget = 'email' ) {
8
- if ( scrumGenerationInProgress ) {
19
+ if ( scrumGenerationInProgress ) {
9
20
console . warn ( '[SCRUM-HELPER]: Scrum generation already in progress, aborting new call.' ) ;
10
21
return ;
11
22
}
@@ -114,13 +125,13 @@ function allIncluded(outputTarget = 'email') {
114
125
handleLastWeekContributionChange ( ) ;
115
126
} else if ( items . yesterdayContribution ) {
116
127
handleYesterdayContributionChange ( ) ;
117
- } else if ( items . startDate && items . endingDate ) {
128
+ } else if ( items . startDate && items . endingDate ) {
118
129
startingDate = items . startingDate ;
119
130
endingDate = items . endingDate ;
120
131
} else {
121
132
handleLastWeekContributionChange ( ) ; //when no date is stored, i.e on fresh unpack - default to last week.
122
- if ( outputTarget === 'popup' ) {
123
- chrome . storage . local . set ( { lastWeekContribution : true , yesterdayContribution : false } ) ;
133
+ if ( outputTarget === 'popup' ) {
134
+ chrome . storage . local . set ( { lastWeekContribution : true , yesterdayContribution : false } ) ;
124
135
}
125
136
}
126
137
@@ -228,17 +239,6 @@ function allIncluded(outputTarget = 'email') {
228
239
return WeekDisplayPadded ;
229
240
}
230
241
231
- const DEBUG = false ;
232
- function log ( ...args ) {
233
- if ( DEBUG ) {
234
- console . log ( `[SCRUM-HELPER]:` , ...args ) ;
235
- }
236
- }
237
- function logError ( ...args ) {
238
- if ( DEBUG ) {
239
- console . error ( '[SCRUM-HELPER]:' , ...args ) ;
240
- }
241
- }
242
242
// Global cache object
243
243
let githubCache = {
244
244
data : null ,
@@ -837,7 +837,7 @@ ${userReason}`;
837
837
let title = item . title ;
838
838
let number = item . number ;
839
839
let li = '' ;
840
- // --- DRAFT PR LOGIC ---
840
+
841
841
let isDraft = false ;
842
842
if ( item . pull_request && typeof item . draft !== 'undefined' ) {
843
843
isDraft = item . draft ;
@@ -993,7 +993,7 @@ ${userReason}`;
993
993
994
994
// allIncluded('email');
995
995
996
- if ( window . location . protocol . startsWith ( 'http' ) ) {
996
+ if ( window . location . protocol . startsWith ( 'http' ) ) {
997
997
allIncluded ( 'email' ) ;
998
998
$ ( 'button>span:contains(New conversation)' ) . parent ( 'button' ) . click ( ( ) => {
999
999
allIncluded ( ) ;
@@ -1015,9 +1015,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
1015
1015
}
1016
1016
} ) ;
1017
1017
1018
- // Replace all references to pr_unmerged_button, pr_merged_true_button, pr_merged_false_button with unified names
1019
- // ... existing code ...
1020
- // Refactor fetchPrMergedStatus to batch requests
1018
+
1021
1019
async function fetchPrsMergedStatusBatch ( prs , headers ) {
1022
1020
// prs: Array of {owner, repo, number}
1023
1021
const results = { } ;
@@ -1095,7 +1093,7 @@ async function writeGithubIssuesPrs() {
1095
1093
let title = item . title ;
1096
1094
let number = item . number ;
1097
1095
let li = '' ;
1098
- // --- DRAFT PR LOGIC ---
1096
+
1099
1097
let isDraft = false ;
1100
1098
if ( item . pull_request && typeof item . draft !== 'undefined' ) {
1101
1099
isDraft = item . draft ;
@@ -1180,4 +1178,4 @@ let intervalWriteGithubIssues = setInterval(async () => {
1180
1178
logError ( 'Interval writeGithubIssuesPrs error:' , err ) ;
1181
1179
}
1182
1180
} , 500 ) ;
1183
- // ... existing code ...
1181
+
0 commit comments