Skip to content

Commit a197c91

Browse files
committed
fix logerror in console
1 parent 212076c commit a197c91

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

src/scripts/scrumHelper.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
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+
}
112
console.log('Script loaded, adapter exists:', !!window.emailClientAdapter);
213
let refreshButton_Placed = false;
314
let enableToggle = true;
415
let hasInjectedContent = false;
516
let scrumGenerationInProgress = false;
617
let orgName = 'fossasia'; // default
718
function allIncluded(outputTarget = 'email') {
8-
if(scrumGenerationInProgress) {
19+
if (scrumGenerationInProgress) {
920
console.warn('[SCRUM-HELPER]: Scrum generation already in progress, aborting new call.');
1021
return;
1122
}
@@ -114,13 +125,13 @@ function allIncluded(outputTarget = 'email') {
114125
handleLastWeekContributionChange();
115126
} else if (items.yesterdayContribution) {
116127
handleYesterdayContributionChange();
117-
} else if(items.startDate && items.endingDate) {
128+
} else if (items.startDate && items.endingDate) {
118129
startingDate = items.startingDate;
119130
endingDate = items.endingDate;
120131
} else {
121132
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 });
124135
}
125136
}
126137

@@ -228,17 +239,6 @@ function allIncluded(outputTarget = 'email') {
228239
return WeekDisplayPadded;
229240
}
230241

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-
}
242242
// Global cache object
243243
let githubCache = {
244244
data: null,
@@ -837,7 +837,7 @@ ${userReason}`;
837837
let title = item.title;
838838
let number = item.number;
839839
let li = '';
840-
// --- DRAFT PR LOGIC ---
840+
841841
let isDraft = false;
842842
if (item.pull_request && typeof item.draft !== 'undefined') {
843843
isDraft = item.draft;
@@ -993,7 +993,7 @@ ${userReason}`;
993993

994994
// allIncluded('email');
995995

996-
if(window.location.protocol.startsWith('http')) {
996+
if (window.location.protocol.startsWith('http')) {
997997
allIncluded('email');
998998
$('button>span:contains(New conversation)').parent('button').click(() => {
999999
allIncluded();
@@ -1015,9 +1015,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
10151015
}
10161016
});
10171017

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+
10211019
async function fetchPrsMergedStatusBatch(prs, headers) {
10221020
// prs: Array of {owner, repo, number}
10231021
const results = {};
@@ -1095,7 +1093,7 @@ async function writeGithubIssuesPrs() {
10951093
let title = item.title;
10961094
let number = item.number;
10971095
let li = '';
1098-
// --- DRAFT PR LOGIC ---
1096+
10991097
let isDraft = false;
11001098
if (item.pull_request && typeof item.draft !== 'undefined') {
11011099
isDraft = item.draft;
@@ -1180,4 +1178,4 @@ let intervalWriteGithubIssues = setInterval(async () => {
11801178
logError('Interval writeGithubIssuesPrs error:', err);
11811179
}
11821180
}, 500);
1183-
// ... existing code ...
1181+

0 commit comments

Comments
 (0)