일정 관리 상태 복원 로직 수정 - back_forward 타입일 때만 복원

- 뒤로가기/앞으로가기: 상태 복원
- 새로고침(reload), 직접 진입(navigate): 상태 초기화
This commit is contained in:
caadiq 2026-01-06 12:08:58 +09:00
parent a3573ec990
commit 31f15fe20b

View file

@ -21,19 +21,18 @@ function AdminSchedule() {
};
// sessionStorage
// / (scheduleToast )
//
// ,
const getStoredState = () => {
try {
// scheduleToast ->
const hasScheduleToast = sessionStorage.getItem('scheduleToast');
if (!hasScheduleToast) {
//
sessionStorage.removeItem('adminScheduleState');
return null;
const navType = performance.getEntriesByType('navigation')[0]?.type;
// /
if (navType === 'back_forward') {
const stored = sessionStorage.getItem('adminScheduleState');
return stored ? JSON.parse(stored) : null;
}
const stored = sessionStorage.getItem('adminScheduleState');
return stored ? JSON.parse(stored) : null;
// (reload, navigate)
sessionStorage.removeItem('adminScheduleState');
return null;
} catch { return null; }
};
const storedState = getStoredState();