fix(monthly-confirm): 무한 로딩 수정 — window.currentUser → getCurrentUser()

tkfb-core.js의 currentUser는 let 모듈 스코프라 window에 안 붙음.
getCurrentUser() 함수 사용으로 전환.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-01 06:51:26 +09:00
parent ca09f89cda
commit 617b6f5c6f
2 changed files with 6 additions and 3 deletions

View File

@@ -24,7 +24,9 @@ document.addEventListener('DOMContentLoaded', function() {
if (params.get('month')) currentMonth = parseInt(params.get('month'));
setTimeout(function() {
if (!window.currentUser) return;
var user = typeof getCurrentUser === 'function' ? getCurrentUser() : window.currentUser;
if (!user) return;
window._mmcUser = user;
updateMonthLabel();
loadData();
}, 500);
@@ -49,7 +51,8 @@ async function loadData() {
tableWrap.innerHTML = '<div class="mmc-skeleton"></div><div class="mmc-skeleton"></div><div class="mmc-skeleton"></div>';
try {
var userId = window.currentUser.user_id || window.currentUser.id;
var user = window._mmcUser || (typeof getCurrentUser === 'function' ? getCurrentUser() : null) || {};
var userId = user.user_id || user.id;
var [recordsRes, balanceRes] = await Promise.all([
window.apiCall('/monthly-comparison/my-records?year=' + currentYear + '&month=' + currentMonth),
window.apiCall('/attendance/vacation-balance/' + userId).catch(function() { return { success: true, data: [] }; })

View File

@@ -103,7 +103,7 @@
<script src="/static/js/tkfb-core.js?v=2026033108"></script>
<script src="/js/api-base.js?v=2026031701"></script>
<script src="/js/my-monthly-confirm.js?v=2026033101"></script>
<script src="/js/my-monthly-confirm.js?v=2026040101"></script>
<script>initAuth();</script>
</body>
</html>