From 026c68aa52a75b43744153789cd36173d3834e0d Mon Sep 17 00:00:00 2001 From: caadiq Date: Tue, 6 Jan 2026 12:05:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=83=81=ED=83=9C=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EC=88=98=EC=A0=95=20-=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EA=B3=A0=EC=B9=A8/=EC=A7=81=EC=A0=91=20=EC=A7=84=EC=9E=85=20?= =?UTF-8?q?=EC=8B=9C=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - navigation type 체크: reload나 navigate일 때 sessionStorage 상태 제거 - 뒤로가기(back_forward)에서만 상태 복원 --- frontend/src/pages/pc/admin/AdminSchedule.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) 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);