From 6ff803485624b5478e471805ad6273916705875e Mon Sep 17 00:00:00 2001 From: 0310700 Date: Wed, 1 Jul 2026 10:10:14 +0900 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=ED=86=A0=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=ED=9B=84=20=EC=A3=BC=EC=86=8C=EC=B0=BD?= =?UTF-8?q?=EC=9D=98=20=3Ftoast=C2=B7=3Fegg=C2=B7=3Fopen=20=EC=BF=BC?= =?UTF-8?q?=EB=A6=AC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit initSignals 가 신호를 소비한 뒤 history.replaceState 로 1회성 쿼리만 제거. POST→Redirect→GET·비-JS 폴백은 유지하고, 새로고침/공유 시 토스트 재출력도 방지. Co-Authored-By: Claude Opus 4.8 --- public/js/main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/js/main.js b/public/js/main.js index 6e2ef3b..98eb0fa 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -16,6 +16,18 @@ function initSignals() { else if (egg === "rocket") burstRocket(); const open = b.getAttribute("data-open-modal"); if (open) openDetail(open); + stripSignalParams(); +} + +// 1회성 신호 쿼리(toast/egg/open)는 표시 후 주소창에서 지운다. +// history.replaceState 라 새 히스토리 항목 없이 URL 만 정리 → 새로고침/공유 시 토스트가 다시 뜨지 않는다. +function stripSignalParams() { + try { + const url = new URL(window.location.href); + const before = url.search; + ["toast", "egg", "open"].forEach((k) => url.searchParams.delete(k)); + if (url.search !== before) history.replaceState(null, "", url.pathname + url.search + url.hash); + } catch (e) {} } function consoleArt() {