mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00: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
1 changed files with 12 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { afterNavigate } from '$app/navigation';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
import Icon from '$lib/components/elements/icon.svelte';
|
||||||
import { Theme } from '$lib/constants';
|
import { Theme } from '$lib/constants';
|
||||||
import { modalManager } from '$lib/managers/modal-manager.svelte';
|
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 () => {
|
onMount(async () => {
|
||||||
if (!mapMarkers) {
|
if (!mapMarkers) {
|
||||||
mapMarkers = await loadMapMarkers();
|
mapMarkers = await loadMapMarkers();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue