diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index 5412464766f29..215707543c01f 100644 --- a/web/src/lib/stores/assets.store.ts +++ b/web/src/lib/stores/assets.store.ts @@ -398,7 +398,9 @@ export class AssetStore { } async updateOptions(options: AssetStoreOptions) { - if (!this.initialized) { + // Make sure to re-initialize if the personId changes + const needsReinitializing = this.options.personId !== options.personId; + if (!this.initialized && !needsReinitializing) { this.setOptions(options); return; } diff --git a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte index 6788c678ede4c..ac15bcafe4a00 100644 --- a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -74,8 +74,12 @@ const assetStore = new AssetStore(assetStoreOptions); $effect(() => { + const change = assetStoreOptions.personId !== data.person.id; assetStoreOptions.personId = data.person.id; handlePromiseError(assetStore.updateOptions(assetStoreOptions)); + if (change) { + assetStore.triggerUpdate(); + } }); const assetInteraction = new AssetInteraction();