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:
@@ -24,7 +24,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
if (params.get('month')) currentMonth = parseInt(params.get('month'));
|
if (params.get('month')) currentMonth = parseInt(params.get('month'));
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if (!window.currentUser) return;
|
var user = typeof getCurrentUser === 'function' ? getCurrentUser() : window.currentUser;
|
||||||
|
if (!user) return;
|
||||||
|
window._mmcUser = user;
|
||||||
updateMonthLabel();
|
updateMonthLabel();
|
||||||
loadData();
|
loadData();
|
||||||
}, 500);
|
}, 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>';
|
tableWrap.innerHTML = '<div class="mmc-skeleton"></div><div class="mmc-skeleton"></div><div class="mmc-skeleton"></div>';
|
||||||
|
|
||||||
try {
|
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([
|
var [recordsRes, balanceRes] = await Promise.all([
|
||||||
window.apiCall('/monthly-comparison/my-records?year=' + currentYear + '&month=' + currentMonth),
|
window.apiCall('/monthly-comparison/my-records?year=' + currentYear + '&month=' + currentMonth),
|
||||||
window.apiCall('/attendance/vacation-balance/' + userId).catch(function() { return { success: true, data: [] }; })
|
window.apiCall('/attendance/vacation-balance/' + userId).catch(function() { return { success: true, data: [] }; })
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
|
|
||||||
<script src="/static/js/tkfb-core.js?v=2026033108"></script>
|
<script src="/static/js/tkfb-core.js?v=2026033108"></script>
|
||||||
<script src="/js/api-base.js?v=2026031701"></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>
|
<script>initAuth();</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user