diff --git a/frontend/src/lib/components/AlbumPanel.svelte b/frontend/src/lib/components/AlbumPanel.svelte index c9656ac..cd1c5b4 100644 --- a/frontend/src/lib/components/AlbumPanel.svelte +++ b/frontend/src/lib/components/AlbumPanel.svelte @@ -9,6 +9,7 @@ import PhotoPanel from './PhotoPanel.svelte'; import { albums } from '$lib/stores/albums.svelte'; import { selection } from '$lib/stores/selection.svelte'; + import { photoUpdates } from '$lib/stores/photo-updates.svelte'; import { transfer } from '$lib/stores/transfer.svelte'; import type { Album, Photo } from '$lib/types'; @@ -52,6 +53,7 @@ function onRenamed(updated: Photo) { photo = updated; if (selectedItems.some((p) => p.id === updated.id)) selection.replace(updated); + photoUpdates.publish(updated); } function onDeleted() { diff --git a/frontend/src/lib/stores/photo-updates.svelte.ts b/frontend/src/lib/stores/photo-updates.svelte.ts new file mode 100644 index 0000000..134179d --- /dev/null +++ b/frontend/src/lib/stores/photo-updates.svelte.ts @@ -0,0 +1,11 @@ +import type { Photo } from '$lib/types'; + +class PhotoUpdatesStore { + latest = $state(null); + + publish(photo: Photo) { + this.latest = photo; + } +} + +export const photoUpdates = new PhotoUpdatesStore(); diff --git a/frontend/src/routes/(app)/albums/[id]/+page.svelte b/frontend/src/routes/(app)/albums/[id]/+page.svelte index 04accee..baa8b41 100644 --- a/frontend/src/routes/(app)/albums/[id]/+page.svelte +++ b/frontend/src/routes/(app)/albums/[id]/+page.svelte @@ -1,7 +1,7 @@