From 2c766e8da64e2396d3f4d96aa36077edc76c301f Mon Sep 17 00:00:00 2001 From: caadiq Date: Tue, 6 Jan 2026 12:10:58 +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?-=20fromScheduleForm=20=ED=94=8C=EB=9E=98=EA=B7=B8=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 일정 추가/수정 버튼 클릭 시 플래그 설정 - 돌아올 때 플래그가 있으면 상태 복원 후 플래그 제거 - 플래그가 없으면 상태 초기화 (새로고침/직접 진입) --- frontend/src/pages/pc/admin/AdminSchedule.jsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) 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() { 봇 관리