Admin: load the bonus panel after login, not before
The panel fetched its tool list on DOMContentLoaded — which fires while the admin page is still showing the login form. The request 401'd, the handler returned silently, and the "What" select was left permanently empty with no path back. Loads from the same post-login block as the coaching radar and messages panels now, plus a refetch if the select is opened while still empty. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -78,7 +78,12 @@
|
|||||||
}catch(e){ msg.style.color='#f0a05a'; msg.textContent='Connection hiccup.'; }
|
}catch(e){ msg.style.color='#f0a05a'; msg.textContent='Connection hiccup.'; }
|
||||||
$('agGo').disabled=false;
|
$('agGo').disabled=false;
|
||||||
}
|
}
|
||||||
document.addEventListener('DOMContentLoaded',function(){ boot(); var b=$('agGo'); if(b) b.addEventListener('click',award); });
|
window.agBoot=boot;
|
||||||
|
document.addEventListener('DOMContentLoaded',function(){
|
||||||
|
var b=$('agGo'); if(b) b.addEventListener('click',award);
|
||||||
|
// Belt and braces: if the select is still empty when it's opened, try again.
|
||||||
|
var sel=$('agTool'); if(sel) sel.addEventListener('focus',function(){ if(!sel.options.length) boot(); });
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body></html>
|
</body></html>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ function render(){
|
|||||||
const orgEl=document.getElementById('orgRoot');if(orgEl&&!orgEl.value)orgEl.value=state.config.orgRootId||'21';
|
const orgEl=document.getElementById('orgRoot');if(orgEl&&!orgEl.value)orgEl.value=state.config.orgRootId||'21';
|
||||||
if(!orgShareAutoLoaded&&orgEl&&orgEl.value){orgShareAutoLoaded=true;loadOrgShare();}
|
if(!orgShareAutoLoaded&&orgEl&&orgEl.value){orgShareAutoLoaded=true;loadOrgShare();}
|
||||||
if(!coachAutoLoaded){coachAutoLoaded=true;loadCoaching();}
|
if(!coachAutoLoaded){coachAutoLoaded=true;loadCoaching();}
|
||||||
|
if(!grantAutoLoaded){grantAutoLoaded=true;if(window.agBoot)window.agBoot();}
|
||||||
if(!msgsAutoLoaded){msgsAutoLoaded=true;loadAdminMsgs();}
|
if(!msgsAutoLoaded){msgsAutoLoaded=true;loadAdminMsgs();}
|
||||||
const efi=document.getElementById('emailFromInput');if(efi&&!efi.value)efi.value=state.config.emailFrom||em.from||'';
|
const efi=document.getElementById('emailFromInput');if(efi&&!efi.value)efi.value=state.config.emailFrom||em.from||'';
|
||||||
const f=document.getElementById('configForm'),c=state.config;for(const k of ['siteName','programName','bridgeHeadline','bridgeSubheadline','premiumEntryPol','dappReferralBaseUrl','telegramUrl','supportLabel','bemobPostbackUrl','telegramBotToken','telegramChatId','telegramTopicId','teamRootId','teamAlertEmail','ownerAlertEmail'])if(f.elements[k])f.elements[k].value=c[k]??'';f.elements.showSponsorName.checked=!!c.showSponsorName;f.elements.showQueueProgress.checked=!!c.showQueueProgress;
|
const f=document.getElementById('configForm'),c=state.config;for(const k of ['siteName','programName','bridgeHeadline','bridgeSubheadline','premiumEntryPol','dappReferralBaseUrl','telegramUrl','supportLabel','bemobPostbackUrl','telegramBotToken','telegramChatId','telegramTopicId','teamRootId','teamAlertEmail','ownerAlertEmail'])if(f.elements[k])f.elements[k].value=c[k]??'';f.elements.showSponsorName.checked=!!c.showSponsorName;f.elements.showQueueProgress.checked=!!c.showQueueProgress;
|
||||||
@@ -124,6 +125,7 @@ async function loadCoaching(){
|
|||||||
}
|
}
|
||||||
const cr=document.getElementById('coachRefresh');if(cr)cr.addEventListener('click',loadCoaching);
|
const cr=document.getElementById('coachRefresh');if(cr)cr.addEventListener('click',loadCoaching);
|
||||||
let coachAutoLoaded=false;
|
let coachAutoLoaded=false;
|
||||||
|
let grantAutoLoaded=false;
|
||||||
async function loadAdminMsgs(){
|
async function loadAdminMsgs(){
|
||||||
const tb=document.getElementById('msgRows');if(!tb)return;
|
const tb=document.getElementById('msgRows');if(!tb)return;
|
||||||
try{
|
try{
|
||||||
|
|||||||
Reference in New Issue
Block a user