From cf05c6580dee353a46830d92262ef6d9a012c890 Mon Sep 17 00:00:00 2001 From: 3252a8 <3252a8@proton.me> Date: Thu, 28 May 2026 15:05:48 +0300 Subject: [PATCH] fix: keep demo mock switch on app shell --- docs-site/public/demo/demo-shell.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs-site/public/demo/demo-shell.js b/docs-site/public/demo/demo-shell.js index f0db86b..4ae20aa 100644 --- a/docs-site/public/demo/demo-shell.js +++ b/docs-site/public/demo/demo-shell.js @@ -103,6 +103,13 @@ const materializedRouteFromRuntime = (route) => { }; const publicPathFromRoute = (route) => `${demoBase}${materializedRouteFromRuntime(route)}`; +const runtimeSrc = (route, searchParams = new URLSearchParams()) => { + const nextParams = new URLSearchParams(searchParams); + nextParams.delete("screen"); + nextParams.delete("admin_section"); + nextParams.set("path", normalizePath(route)); + return `${runtimeBase}/app.html?${nextParams.toString()}${window.location.hash || ""}`; +}; const topbar = document.querySelector(".demo-topbar"); const toggle = document.querySelector(".demo-topbar__toggle"); const hide = document.querySelector(".demo-topbar__hide"); @@ -156,5 +163,5 @@ stateSelect?.addEventListener("change", () => { const query = nextParams.toString(); const publicUrl = `${demoBase}/home${query ? `?${query}` : ""}`; window.history.replaceState(null, "", publicUrl); - frame.src = `${runtimeBase}/home?mock=${mock}`; + frame.src = runtimeSrc("/home", nextParams); });