mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 17:25:35 +03:00
feat(web): add geolocation utility (#20758)
* feat(geolocation): add geolocation utility * feat(web): geolocation utility - fix code review - 1 * feat(web): geolocation utility - fix code review - 2 * chore: cleanup * chore: feedback * feat(web): add animation and text animation on locations change and action text on thumbnail * styling, messages and filtering * selected color * format i18n * fix lint --------- Co-authored-by: Jason Rasmussen <jason@rasm.me> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -145,3 +145,16 @@ export const clearQueryParam = async (queryParam: string, url: URL) => {
|
||||
await goto(url, { keepFocus: true });
|
||||
}
|
||||
};
|
||||
|
||||
export const getQueryValue = (queryKey: string) => {
|
||||
const url = globalThis.location.href;
|
||||
const urlObject = new URL(url);
|
||||
return urlObject.searchParams.get(queryKey);
|
||||
};
|
||||
|
||||
export const setQueryValue = async (queryKey: string, queryValue: string) => {
|
||||
const url = globalThis.location.href;
|
||||
const urlObject = new URL(url);
|
||||
urlObject.searchParams.set(queryKey, queryValue);
|
||||
await goto(urlObject, { keepFocus: true });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user