From a3573ec9904720d12cb55a32057910428e2b1d85 Mon Sep 17 00:00:00 2001 From: caadiq Date: Tue, 6 Jan 2026 12:07:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EB=B3=B5=EC=9B=90=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0=20-=20scheduleToast=20=EA=B8=B0=EB=B0=98=20?= =?UTF-8?q?=ED=8C=90=EB=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scheduleToast가 있을 때만 상태 복원 (일정 폼에서 돌아올 때) - 그 외에는 상태 초기화 --- frontend/src/pages/pc/admin/AdminSchedule.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/pc/admin/AdminSchedule.jsx b/frontend/src/pages/pc/admin/AdminSchedule.jsx index a46b7ef..0e8dbb4 100644 --- a/frontend/src/pages/pc/admin/AdminSchedule.jsx +++ b/frontend/src/pages/pc/admin/AdminSchedule.jsx @@ -21,12 +21,14 @@ function AdminSchedule() { }; // sessionStorage에서 저장된 상태 복원 - // 새로고침이나 직접 URL 진입 시에는 복원하지 않음 (뒤로가기 등에서만 복원) + // 일정 추가/수정 후 돌아올 때만 복원 (scheduleToast가 있을 때) + // 새로고침이나 메뉴에서 직접 진입 시에는 초기화 const getStoredState = () => { try { - // 새로고침이나 직접 진입인 경우 상태 초기화 - const navType = performance.getEntriesByType('navigation')[0]?.type; - if (navType === 'reload' || navType === 'navigate') { + // scheduleToast가 있으면 일정 폼에서 돌아온 것 -> 상태 유지 + const hasScheduleToast = sessionStorage.getItem('scheduleToast'); + if (!hasScheduleToast) { + // 일정 폼에서 돌아온 게 아니면 상태 초기화 sessionStorage.removeItem('adminScheduleState'); return null; }