fix: resolve script loading timing issue with admin-session.js
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m39s

Problem: App.razor's inline initialization script was executing before
admin-session.js was fully loaded, causing window.taxbaikAdminSession to be
undefined. This prevented form binding and login event handler attachment.

Flow problem:
1. admin-session.js starts loading (async)
2. inline <script> executes immediately (sync)
3. window.taxbaikAdminSession is still undefined
4. bindLoginForm() call fails silently
5. form submit handler never attached
6. login button click doesn't trigger form submission

Solution: Add retry loop with 50ms intervals until admin-session.js is loaded.
This ensures form binding happens after the module is ready.

Result: Form submission now works correctly, completing the login flow.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 13:49:37 +09:00
parent 840528698c
commit 47dc8c6c57
@@ -50,15 +50,24 @@
<script src="/taxbaik/js/admin-session.js"></script>
<script src="/taxbaik/_framework/blazor.webassembly.js"></script>
<script>
if (window.taxbaikAdminSession && typeof window.taxbaikAdminSession.initErrorLogging === 'function') {
window.taxbaikAdminSession.initErrorLogging();
}
if (window.taxbaikAdminSession && typeof window.taxbaikAdminSession.bindLoginForm === 'function') {
window.taxbaikAdminSession.bindLoginForm();
}
if (window.taxbaikAdminSession && typeof window.taxbaikAdminSession.watchReconnect === 'function') {
window.taxbaikAdminSession.watchReconnect();
// admin-session.js 로드 완료 대기 후 초기화
function initSession() {
if (window.taxbaikAdminSession) {
if (typeof window.taxbaikAdminSession.initErrorLogging === 'function') {
window.taxbaikAdminSession.initErrorLogging();
}
if (typeof window.taxbaikAdminSession.bindLoginForm === 'function') {
window.taxbaikAdminSession.bindLoginForm();
}
if (typeof window.taxbaikAdminSession.watchReconnect === 'function') {
window.taxbaikAdminSession.watchReconnect();
}
} else {
// admin-session.js가 아직 로드되지 않았으면 재시도
setTimeout(initSession, 50);
}
}
initSession();
</script>
</body>
</html>