From 02932bb3dac61ff7a48a336c4cbe017f64e28659 Mon Sep 17 00:00:00 2001 From: Agata Date: Thu, 31 Oct 2024 09:28:08 +0100 Subject: [PATCH] Brandon suggestion --- .../ensure-playground-site-is-selected.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx b/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx index bfe30f856c..373c6b4460 100644 --- a/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx +++ b/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx @@ -88,8 +88,9 @@ export function EnsurePlaygroundSiteIsSelected({ const notRefreshingParam = 'modal'; const oldParams = new URLSearchParams(prevUrl?.search); const newParams = new URLSearchParams(url?.search); - - if ((!oldParams.has(notRefreshingParam) && newParams.has(notRefreshingParam)) || (oldParams.has(notRefreshingParam) && !newParams.has(notRefreshingParam))) { + oldParams.delete(notRefreshingParam); + newParams.delete(notRefreshingParam); + if (oldParams.toString() === newParams.toString()) { return; }