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() {