diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx index 1606c06bb4..907e2fa67b 100644 --- a/apps/web/components/Embed.tsx +++ b/apps/web/components/Embed.tsx @@ -57,10 +57,13 @@ const goto = (router: NextRouter, searchParams: Record) => { }; const removeQueryParams = (router: NextRouter, queryParams: string[]) => { + const params = new URLSearchParams(window.location.search); + queryParams.forEach((param) => { - delete router.query[param]; + params.delete(param); }); - router.push(`${router.asPath.split("?")[0]}?${router.query.toString()}`); + + router.push(`${router.asPath.split("?")[0]}?${params.toString()}`); }; /**