fix(ui): propagate photo tag edits to grid and viewer
Add a shared photo-updates signal the panel publishes on rename or tag add/remove; the album grid and viewer subscribe and patch the changed photo into their lists, so the 360 badge and panorama mode update without a reload.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { Photo } from '$lib/types';
|
||||
|
||||
class PhotoUpdatesStore {
|
||||
latest = $state<Photo | null>(null);
|
||||
|
||||
publish(photo: Photo) {
|
||||
this.latest = photo;
|
||||
}
|
||||
}
|
||||
|
||||
export const photoUpdates = new PhotoUpdatesStore();
|
||||
Reference in New Issue
Block a user