fix(ui): 토스트 표시 후 주소창의 ?toast·?egg·?open 쿼리 제거
initSignals 가 신호를 소비한 뒤 history.replaceState 로 1회성 쿼리만 제거. POST→Redirect→GET·비-JS 폴백은 유지하고, 새로고침/공유 시 토스트 재출력도 방지. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,18 @@ function initSignals() {
|
|||||||
else if (egg === "rocket") burstRocket();
|
else if (egg === "rocket") burstRocket();
|
||||||
const open = b.getAttribute("data-open-modal");
|
const open = b.getAttribute("data-open-modal");
|
||||||
if (open) openDetail(open);
|
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() {
|
function consoleArt() {
|
||||||
|
|||||||
Reference in New Issue
Block a user