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:
@@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user