From f96683136f9e96426a8876ba2bf21e1451cecec2 Mon Sep 17 00:00:00 2001 From: Alexis Jacomy Date: Wed, 5 Feb 2025 17:48:50 +0100 Subject: [PATCH] [broadcast] Cleans broadcast query on startup This fixes @sim51's comment on #181. --- packages/gephi-lite/src/core/Initialize.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/gephi-lite/src/core/Initialize.tsx b/packages/gephi-lite/src/core/Initialize.tsx index ff5261e..1cdc009 100644 --- a/packages/gephi-lite/src/core/Initialize.tsx +++ b/packages/gephi-lite/src/core/Initialize.tsx @@ -150,6 +150,15 @@ export const Initialize: FC> = ({ children }) => { } } + // Clean URL: + if (broadcastID) { + const newSearch = new URLSearchParams(location.search); + newSearch.delete("broadcast"); + const searchStr = newSearch.toString(); + const cleanedURL = location.pathname + (searchStr ? "?" + searchStr : ""); + history.replaceState(null, "", cleanedURL); + } + if (showWelcomeModal) openModal({ component: WelcomeModal,