diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/EnvironmentDrawer.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/EnvironmentDrawer.tsx index 713df53a..24f6c640 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/EnvironmentDrawer.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/EnvironmentDrawer.tsx @@ -58,6 +58,7 @@ export const useEnvironmentDrawer = () => { const url = new URL(window.location.href); if (id === null) { url.searchParams.delete(param); + url.searchParams.delete(tabParam); router.replace(`${url.pathname}?${url.searchParams.toString()}`); return; } @@ -65,10 +66,7 @@ export const useEnvironmentDrawer = () => { router.replace(`${url.pathname}?${url.searchParams.toString()}`); }; - const removeEnvironmentId = () => { - setTab(null); - setEnvironmentId(null); - }; + const removeEnvironmentId = () => setEnvironmentId(null); return { environmentId, setEnvironmentId, removeEnvironmentId, tab, setTab }; }; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx index d786a58d..86a49853 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/EnvironmentPolicyDrawer.tsx @@ -73,6 +73,7 @@ export const useEnvironmentPolicyDrawer = () => { const url = new URL(window.location.href); if (id === null) { url.searchParams.delete(param); + url.searchParams.delete(tabParam); router.replace(`${url.pathname}?${url.searchParams.toString()}`); return; }