Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/scripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,11 @@ document.addEventListener('DOMContentLoaded', function () {
if (oldToast) oldToast.parentNode.removeChild(oldToast);
console.log('[Org Check] Organisation exists on GitHub:', org);
// Valid org: update storage and fetch data
chrome.storage.local.set({ orgName: org }, function () {
if (window.generateScrumReport) window.generateScrumReport();
chrome.storage.local.set({ orgName: org, githubCache: null }, function () {
const scrumReport = document.getElementById('scrumReport');
if (scrumReport) {
scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
}
});
})
.catch((err) => {
Expand Down Expand Up @@ -430,7 +433,7 @@ document.addEventListener('DOMContentLoaded', function () {
}, 3000);
// Do NOT update storage or fetch data for invalid org
});
}, 3000);
}, 2500);

orgInput.addEventListener('input', handleOrgInput);

Expand Down
7 changes: 7 additions & 0 deletions src/scripts/scrumHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ function allIncluded(outputTarget = 'email') {

await saveToStorage(githubCache.data);
processGithubData(githubCache.data);

if (outputTarget === 'popup') {
issuesDataProcessed = false;
prsReviewDataProcessed = false;
writeGithubIssuesPrs();
writeGithubPrsReviews();
}

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