diff --git a/frontend/src/pages/pc/admin/AdminSchedule.jsx b/frontend/src/pages/pc/admin/AdminSchedule.jsx index 7dc5c6f..20c213d 100644 --- a/frontend/src/pages/pc/admin/AdminSchedule.jsx +++ b/frontend/src/pages/pc/admin/AdminSchedule.jsx @@ -21,16 +21,17 @@ function AdminSchedule() { }; // sessionStorage에서 저장된 상태 복원 - // 뒤로가기로 돌아올 때만 복원, 새로고침이나 직접 진입 시에는 초기화 + // 일정 폼에서 돌아올 때만 복원 (fromScheduleForm 플래그 확인) const getStoredState = () => { try { - const navType = performance.getEntriesByType('navigation')[0]?.type; - // 뒤로가기/앞으로가기일 때만 상태 복원 - if (navType === 'back_forward') { + const fromForm = sessionStorage.getItem('fromScheduleForm'); + if (fromForm) { + // 플래그 제거 후 상태 복원 + sessionStorage.removeItem('fromScheduleForm'); const stored = sessionStorage.getItem('adminScheduleState'); return stored ? JSON.parse(stored) : null; } - // 그 외(reload, navigate)는 상태 초기화 + // 폼에서 돌아온 게 아니면 상태 초기화 sessionStorage.removeItem('adminScheduleState'); return null; } catch { return null; } @@ -523,7 +524,10 @@ function AdminSchedule() { 봇 관리