Skip to content

High performance self-hosted photo and video management solution.

fix(web): handle deletion from asset viewer on map page (#25393)

Mees Frensel897056686516
diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte
index 334c7c1032..f047b5001a 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte
@@ -11,6 +11,7 @@
import { assetViewerManager } from '$lib/managers/asset-viewer-manager.svelte';
import { authManager } from '$lib/managers/auth-manager.svelte';
import { editManager, EditToolType } from '$lib/managers/edit/edit-manager.svelte';
+ import { eventManager } from '$lib/managers/event-manager.svelte';
import { preloadManager } from '$lib/managers/PreloadManager.svelte';
import { Route } from '$lib/route';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
@@ -321,6 +322,11 @@
await handleGetAllAlbums();
break;
}
+ case AssetAction.DELETE:
+ case AssetAction.TRASH: {
+ eventManager.emit('AssetsDelete', [asset.id]);
+ break;
+ }
case AssetAction.REMOVE_ASSET_FROM_STACK: {
stack = action.stack;
if (stack) {
diff --git a/web/src/lib/components/shared-components/map/map.svelte b/web/src/lib/components/shared-components/map/map.svelte
index e3a926f9b6..bdbbea5b66 100644
--- a/web/src/lib/components/shared-components/map/map.svelte
+++ b/web/src/lib/components/shared-components/map/map.svelte
@@ -10,6 +10,7 @@
<script lang="ts">
import { afterNavigate } from '$app/navigation';
+ import OnEvents from '$lib/components/OnEvents.svelte';
import { Theme } from '$lib/constants';
import { serverConfigManager } from '$lib/managers/server-config-manager.svelte';
import { themeManager } from '$lib/managers/theme-manager.svelte';
@@ -292,8 +293,14 @@
untrack(() => map?.jumpTo({ center, zoom }));
});
+
+ const onAssetsDelete = async () => {
+ mapMarkers = await loadMapMarkers();
+ };
</script>
+<OnEvents {onAssetsDelete} />
+
<!-- We handle style loading ourselves so we set style blank here -->
<MapLibre
{hash}