@@ -256,8 +256,8 @@ document.addEventListener('DOMContentLoaded', function () {
256256
257257 const startDateInput = document . getElementById ( 'startingDate' ) ;
258258 const endDateInput = document . getElementById ( 'endingDate' ) ;
259- startDateInput . disabled = false ;
260- endDateInput . disabled = false ;
259+ startDateInput . readOnly = false ;
260+ endDateInput . readOnly = false ;
261261
262262 chrome . storage . local . set ( {
263263 lastWeekContribution : false ,
@@ -294,9 +294,8 @@ document.addEventListener('DOMContentLoaded', function () {
294294 startDateInput . value = getYesterday ( ) ;
295295 endDateInput . value = getToday ( ) ;
296296 }
297-
298- startDateInput . disabled = endDateInput . disabled = true ;
299-
297+ startDateInput . readOnly = endDateInput . readOnly = true ;
298+
300299 chrome . storage . local . set ( {
301300 startingDate : startDateInput . value ,
302301 endingDate : endDateInput . value ,
@@ -369,11 +368,9 @@ document.addEventListener('DOMContentLoaded', function () {
369368 . then ( res => {
370369 console . log ( '[Org Check] Response status for' , org , ':' , res . status ) ;
371370 if ( res . status === 404 ) {
372- console . log ( '[Org Check] Organisation not found on GitHub:' , org ) ;
373- // Remove any existing toast with the same id
371+ console . log ( '[Org Check] Organization not found on GitHub:' , org ) ;
374372 const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
375373 if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
376- // Create a new toast div
377374 const toastDiv = document . createElement ( 'div' ) ;
378375 toastDiv . id = 'invalid-org-toast' ;
379376 toastDiv . className = 'toast' ;
@@ -387,32 +384,34 @@ document.addEventListener('DOMContentLoaded', function () {
387384 toastDiv . style . left = '50%' ;
388385 toastDiv . style . transform = 'translateX(-50%)' ;
389386 toastDiv . style . zIndex = '9999' ;
390- toastDiv . innerText = 'Organisation not found on GitHub.' ;
387+ toastDiv . innerText = 'Organization not found on GitHub.' ;
391388 document . body . appendChild ( toastDiv ) ;
392389 setTimeout ( ( ) => {
393390 if ( toastDiv . parentNode ) toastDiv . parentNode . removeChild ( toastDiv ) ;
394391 } , 3000 ) ;
395- // Do NOT update storage or fetch data for invalid org
396392 return ;
397393 }
398- // Remove any existing toast with the same id (for valid orgs)
399394 const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
400395 if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
401396 console . log ( '[Org Check] Organisation exists on GitHub:' , org ) ;
397+ < << << << preview-bug
402398 // Valid org: update storage and fetch data
403399 chrome . storage . local . set ( { orgName : org , githubCache : null } , function ( ) {
404400 const scrumReport = document . getElementById ( 'scrumReport' ) ;
405401 if ( scrumReport ) {
406402 scrumReport . innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>' ;
407403 }
404+ = === ===
405+ console . log ( '[Org Check] Organization exists on GitHub:' , org ) ;
406+ chrome . storage . local . set ( { orgName : org } , function ( ) {
407+ if ( window . generateScrumReport ) window . generateScrumReport ( ) ;
408+ > >>> >>> master
408409 } ) ;
409410 } )
410411 . catch ( ( err ) => {
411412 console . log ( '[Org Check] Error validating organisation:' , org , err ) ;
412- // Remove any existing toast with the same id
413413 const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
414414 if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
415- // Create a new toast div
416415 const toastDiv = document . createElement ( 'div' ) ;
417416 toastDiv . id = 'invalid-org-toast' ;
418417 toastDiv . className = 'toast' ;
@@ -426,12 +425,11 @@ document.addEventListener('DOMContentLoaded', function () {
426425 toastDiv . style . left = '50%' ;
427426 toastDiv . style . transform = 'translateX(-50%)' ;
428427 toastDiv . style . zIndex = '9999' ;
429- toastDiv . innerText = 'Error validating organisation .' ;
428+ toastDiv . innerText = 'Error validating organization .' ;
430429 document . body . appendChild ( toastDiv ) ;
431430 setTimeout ( ( ) => {
432431 if ( toastDiv . parentNode ) toastDiv . parentNode . removeChild ( toastDiv ) ;
433432 } , 3000 ) ;
434- // Do NOT update storage or fetch data for invalid org
435433 } ) ;
436434 } , 2500 ) ;
437435
@@ -488,8 +486,8 @@ document.querySelectorAll('input[name="timeframe"]').forEach(radio => {
488486
489487 const startDateInput = document . getElementById ( 'startingDate' ) ;
490488 const endDateInput = document . getElementById ( 'endingDate' ) ;
491- startDateInput . disabled = false ;
492- endDateInput . disabled = false ;
489+ startDateInput . readOnly = false ;
490+ endDateInput . readOnly = false ;
493491
494492 chrome . storage . local . set ( {
495493 lastWeekContribution : false ,
@@ -561,7 +559,7 @@ function toggleRadio(radio) {
561559 endDateInput . value = getToday ( ) ;
562560 }
563561
564- startDateInput . disabled = endDateInput . disabled = true ;
562+ startDateInput . readOnly = endDateInput . readOnly = true ;
565563
566564 chrome . storage . local . set ( {
567565 startingDate : startDateInput . value ,
@@ -579,7 +577,7 @@ function toggleRadio(radio) {
579577 } ) ;
580578}
581579
582- const cacheInput = document . getElementById ( 'cacheInput' ) ;
580+ let cacheInput = document . getElementById ( 'cacheInput' ) ;
583581if ( cacheInput ) {
584582 chrome . storage . local . get ( [ 'cacheInput' ] , function ( result ) {
585583 if ( result . cacheInput ) {
0 commit comments