mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-15 05:34:05 +02:00
Fix back button not working
This commit is contained in:
@@ -10,6 +10,10 @@ export function getUrlParams() {
|
|||||||
|
|
||||||
export function deleteUrlParam(key: string) {
|
export function deleteUrlParam(key: string) {
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
|
if (!url.searchParams.has(key)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
url.searchParams.delete(key);
|
url.searchParams.delete(key);
|
||||||
window.history.pushState(null, '', url.toString());
|
window.history.pushState(null, '', url.toString());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user