mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
fix(web): remove query parameter when clearing search (#8817)
fix: remove query parameter when clearing search
This commit is contained in:
parent
f959f2de85
commit
7ce1662b05
2 changed files with 17 additions and 7 deletions
web/src/lib/utils
|
@ -1,3 +1,12 @@
|
|||
import { goto } from '$app/navigation';
|
||||
|
||||
export const isExternalUrl = (url: string): boolean => {
|
||||
return new URL(url, window.location.href).origin !== window.location.origin;
|
||||
};
|
||||
|
||||
export const clearQueryParam = async (queryParam: string, url: URL) => {
|
||||
if (url.searchParams.has(queryParam)) {
|
||||
url.searchParams.delete(queryParam);
|
||||
await goto(url);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue