@@ -32,7 +32,7 @@ <h2>Council login</h2>
3232 < input id ="adminPass " type ="password " autocomplete ="current-password " placeholder ="•••••••• " />
3333 </ div >
3434 < div id ="loginErr "> </ div >
35- < button class ="btn block " id ="loginBtn "> Log in</ button >
35+ < button class ="btn block " id ="loginBtn " onclick =" window._loginClick() " > Log in</ button >
3636 </ div >
3737
3838 < div id ="dashboard " class ="hidden ">
@@ -972,11 +972,6 @@ <h4>Pending UPI payments <span id="pendingCount" class="pending-badge">0</span><
972972let dashboardRefreshSeq = 0 , dashboardRefreshTimer = null , cacheRefreshTimer = null ;
973973// Configuration
974974
975- // Attach login listeners early (before Firebase init await, so button always works)
976- try {
977- const loginBtn = $ ( "loginBtn" ) ;
978- if ( loginBtn ) loginBtn . addEventListener ( "click" , login ) ;
979- } catch ( e ) { console . error ( "Failed to attach login button listener:" , e ) ; }
980975try {
981976 const adminPass = $ ( "adminPass" ) ;
982977 if ( adminPass ) adminPass . addEventListener ( "keydown" , e => { if ( e . key === "Enter" ) login ( ) ; } ) ;
@@ -1039,6 +1034,10 @@ <h4>Pending UPI payments <span id="pendingCount" class="pending-badge">0</span><
10391034 }
10401035}
10411036
1037+ window . _loginClick = function _loginFallback ( ) {
1038+ if ( typeof login === 'function' ) return login ( ) ;
1039+ document . getElementById ( "loginErr" ) . innerHTML = '<div class="notice err">App is still loading... please wait</div>' ;
1040+ } ;
10421041function showModeBanner ( msg ) {
10431042 document . querySelector ( "main" ) . insertAdjacentHTML ( "afterbegin" , `<div class="config-warn">${ msg } </div>` ) ;
10441043}
0 commit comments