From f601368992da3138445f25d41b6577babf587368 Mon Sep 17 00:00:00 2001 From: shum Date: Thu, 10 Sep 2026 17:13:44 +0000 Subject: [PATCH] website: restore only shareable routes, not order screens --- website/src/badges.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/src/badges.html b/website/src/badges.html index 1580288d67..16368decb9 100644 --- a/website/src/badges.html +++ b/website/src/badges.html @@ -172,11 +172,15 @@ templateEngineOverride: njk window.addEventListener("message", function (e) { if (e.origin !== APP || !e.data) return; - // The frame announces itself on load; hand it the site's theme, background and route. + // The frame announces itself on load; hand it the site's theme and background, and + // restore the route we persisted — but only a non-empty one. An empty hash means the + // frame was last on the landing or an order/payment screen it resumes from its own + // store; posting "" would drive it to the landing over a payment mid-way through, so + // we stay out of the way and let it self-resume. if (e.data.type === "simplex-embed-ready") { post({ type: "simplex-theme", theme: siteTheme() }); postColors(); - postRoute(); + if (location.hash) postRoute(); } // The buyer used the theme switch inside the frame; keep the site in step. if (e.data.type === "simplex-theme") { applySiteTheme(e.data.theme); postColors(); }