일정 관리 상태 복원 로직 개선 - scheduleToast 기반 판별

- scheduleToast가 있을 때만 상태 복원 (일정 폼에서 돌아올 때)
- 그 외에는 상태 초기화
This commit is contained in:
caadiq 2026-01-06 12:07:32 +09:00
parent 026c68aa52
commit a3573ec990

View file

@ -21,12 +21,14 @@ function AdminSchedule() {
}; };
// sessionStorage // sessionStorage
// URL ( ) // / (scheduleToast )
//
const getStoredState = () => { const getStoredState = () => {
try { try {
// // scheduleToast ->
const navType = performance.getEntriesByType('navigation')[0]?.type; const hasScheduleToast = sessionStorage.getItem('scheduleToast');
if (navType === 'reload' || navType === 'navigate') { if (!hasScheduleToast) {
//
sessionStorage.removeItem('adminScheduleState'); sessionStorage.removeItem('adminScheduleState');
return null; return null;
} }