diff --git a/A00_Common/app_shell.ts b/A00_Common/app_shell.ts index 6799c8064..791befddd 100644 --- a/A00_Common/app_shell.ts +++ b/A00_Common/app_shell.ts @@ -51,8 +51,14 @@ function onApp_Lang_Toggle_Click(): void { /** 로그아웃(388-1) — 떠남 확인 먼저 → 서버 로그아웃 → 이 브라우저 자료 지움 → 홈으로 새로고침. */ async function onApp_Logout_Click(): Promise { + // 물음은 라우터처럼 주소가 먼저 옮겨진 뒤 — 안 그러면 B05 · B06 물음이 「같은 페이지」로 보고 안 물음 + const back = window.location.hash; + history.replaceState(null, "", `#/${ROUTES.A01_HOME}`); // hashchange 없이 const guard = takeLeaveGuard(); - if (guard && !(await guard())) return; // [취소] — 머묾 + if (guard && !(await guard())) { + history.replaceState(null, "", back); // [취소] — 머묾 · 주소 되돌림 + return; + } setLeaveGuard(null); const { logout } = await import("../A06_Login/A06_Login_Api_Fetch"); try { @@ -62,7 +68,6 @@ async function onApp_Logout_Click(): Promise { } const { wipeAccountCache } = await import("./b_project_switch"); await wipeAccountCache(); - history.replaceState(null, "", `#/${ROUTES.A01_HOME}`); // hashchange 없이 — 바로 새로고침 window.location.reload(); } diff --git a/resources/tester/test_384_s_logout_wipe.py b/resources/tester/test_384_s_logout_wipe.py index 9f6d53d95..2b9da0ee9 100644 --- a/resources/tester/test_384_s_logout_wipe.py +++ b/resources/tester/test_384_s_logout_wipe.py @@ -65,8 +65,9 @@ def test_로그아웃_길_차례(): body = shell[shell.index("async function onApp_Logout_Click") :] body = body[: body.index("\n}\n")] order = [ - body.index(s) for s in ("takeLeaveGuard()", "logout()", "wipeAccountCache()", "reload()") - ] + body.index(s) + for s in ("replaceState(", "takeLeaveGuard()", "logout()", "wipeAccountCache()", "reload()") + ] # 주소 먼저 옮김 — B05 · B06 물음이 「같은 페이지」로 보고 안 묻는 일 막음 assert order == sorted(order) login = (ROOT / "A06_Login/A06_Login_Api_Fetch.ts").read_text(encoding="utf-8") assert "wipeIfOwnerChanged(data.user.id)" in login