mirror of
https://github.com/immich-app/immich.git
synced 2025-07-08 02:34:12 -04:00
fix(web): map broken after redirect from details (#19424)
* fix(web): map broken after redirect from details * chore: use globalThis instead of window
This commit is contained in:
parent
ef278b4fb0
commit
c705a7b280
@ -7,6 +7,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import Icon from '$lib/components/elements/icon.svelte';
|
||||
import { Theme } from '$lib/constants';
|
||||
import { modalManager } from '$lib/managers/modal-manager.svelte';
|
||||
@ -213,6 +214,17 @@
|
||||
}
|
||||
};
|
||||
|
||||
afterNavigate(() => {
|
||||
if (map) {
|
||||
map.resize();
|
||||
|
||||
if (globalThis.location.hash) {
|
||||
const hashChangeEvent = new HashChangeEvent('hashchange');
|
||||
globalThis.dispatchEvent(hashChangeEvent);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onMount(async () => {
|
||||
if (!mapMarkers) {
|
||||
mapMarkers = await loadMapMarkers();
|
||||
|
Loading…
x
Reference in New Issue
Block a user