1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-12 20:24:21 +02:00

Fix back button not working

This commit is contained in:
Kamran Ahmed
2023-09-26 21:18:35 +01:00
parent f27aa58ac3
commit 573263ed74

View File

@@ -10,6 +10,10 @@ export function getUrlParams() {
export function deleteUrlParam(key: string) {
const url = new URL(window.location.href);
if (!url.searchParams.has(key)) {
return;
}
url.searchParams.delete(key);
window.history.pushState(null, '', url.toString());
}