From 4b532646cbacb58737a55a6f8073fc66c4b97adc Mon Sep 17 00:00:00 2001 From: Nafees Nazik <84864519+G3root@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:27:23 +0530 Subject: [PATCH] fix: back url (#5414) Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/components/Embed.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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()}`); }; /**