Skip to content

Commit 8ad29fe

Browse files
committed
fixed report preview
1 parent 4821275 commit 8ad29fe

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/scripts/popup.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,11 @@ document.addEventListener('DOMContentLoaded', function () {
400400
if (oldToast) oldToast.parentNode.removeChild(oldToast);
401401
console.log('[Org Check] Organisation exists on GitHub:', org);
402402
// Valid org: update storage and fetch data
403-
chrome.storage.local.set({ orgName: org }, function () {
404-
if (window.generateScrumReport) window.generateScrumReport();
403+
chrome.storage.local.set({ orgName: org, githubCache: null }, function () {
404+
const scrumReport = document.getElementById('scrumReport');
405+
if (scrumReport) {
406+
scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
407+
}
405408
});
406409
})
407410
.catch((err) => {
@@ -430,7 +433,7 @@ document.addEventListener('DOMContentLoaded', function () {
430433
}, 3000);
431434
// Do NOT update storage or fetch data for invalid org
432435
});
433-
}, 3000);
436+
}, 2500);
434437

435438
orgInput.addEventListener('input', handleOrgInput);
436439

src/scripts/scrumHelper.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,13 @@ function allIncluded(outputTarget = 'email') {
400400

401401
await saveToStorage(githubCache.data);
402402
processGithubData(githubCache.data);
403+
404+
if (outputTarget === 'popup') {
405+
issuesDataProcessed = false;
406+
prsReviewDataProcessed = false;
407+
writeGithubIssuesPrs();
408+
writeGithubPrsReviews();
409+
}
403410

404411
// Resolve queued calls
405412
githubCache.queue.forEach(({ resolve }) => resolve());

0 commit comments

Comments
 (0)