diff --git a/frontend/src/pages/pc/admin/AdminSchedule.jsx b/frontend/src/pages/pc/admin/AdminSchedule.jsx index 20c213d..820f6b9 100644 --- a/frontend/src/pages/pc/admin/AdminSchedule.jsx +++ b/frontend/src/pages/pc/admin/AdminSchedule.jsx @@ -20,9 +20,17 @@ function AdminSchedule() { return kstDate.toISOString().split('T')[0]; }; - // sessionStorage에서 저장된 상태 복원 + // sessionStorage에서 저장된 상태 복원 (한 번만 실행) // 일정 폼에서 돌아올 때만 복원 (fromScheduleForm 플래그 확인) + const stateRestoredRef = useRef(false); const getStoredState = () => { + // 이미 복원 로직이 실행된 경우 다시 실행하지 않음 (StrictMode 이중 마운트 대응) + if (stateRestoredRef.current) { + const stored = sessionStorage.getItem('adminScheduleState'); + return stored ? JSON.parse(stored) : null; + } + stateRestoredRef.current = true; + try { const fromForm = sessionStorage.getItem('fromScheduleForm'); if (fromForm) { @@ -38,6 +46,7 @@ function AdminSchedule() { }; const storedState = getStoredState(); + const [loading, setLoading] = useState(false); const [user, setUser] = useState(null); @@ -517,7 +526,10 @@ function AdminSchedule() {