Skip to content

Commit

Permalink
fix: Delete tab param on drawer close
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Nov 1, 2024
1 parent a027d4d commit bbf326d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ 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;
}
url.searchParams.set(param, id);
router.replace(`${url.pathname}?${url.searchParams.toString()}`);
};

const removeEnvironmentId = () => {
setTab(null);
setEnvironmentId(null);
};
const removeEnvironmentId = () => setEnvironmentId(null);

return { environmentId, setEnvironmentId, removeEnvironmentId, tab, setTab };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bbf326d

Please sign in to comment.