diff --git a/frontend/src/pages/pc/admin/AdminSchedule.jsx b/frontend/src/pages/pc/admin/AdminSchedule.jsx index 6cbb564..a46b7ef 100644 --- a/frontend/src/pages/pc/admin/AdminSchedule.jsx +++ b/frontend/src/pages/pc/admin/AdminSchedule.jsx @@ -21,13 +21,21 @@ function AdminSchedule() { }; // sessionStorage에서 저장된 상태 복원 + // 새로고침이나 직접 URL 진입 시에는 복원하지 않음 (뒤로가기 등에서만 복원) const getStoredState = () => { try { + // 새로고침이나 직접 진입인 경우 상태 초기화 + const navType = performance.getEntriesByType('navigation')[0]?.type; + if (navType === 'reload' || navType === 'navigate') { + sessionStorage.removeItem('adminScheduleState'); + return null; + } const stored = sessionStorage.getItem('adminScheduleState'); return stored ? JSON.parse(stored) : null; } catch { return null; } }; const storedState = getStoredState(); + const [loading, setLoading] = useState(false); const [user, setUser] = useState(null);