From 0250a7a23a93ecfaf09ed89d6fafac53ea58237e Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 27 Dec 2024 11:16:07 -0500 Subject: [PATCH] fix(web): Fix for failing to load pictures (#14943) * attempt at fix for failing to load pictures * comments * remove unused files --------- Co-authored-by: Alex Tran --- web/src/lib/stores/assets.store.ts | 4 +++- .../[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index 5412464766..215707543c 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 e1e50cfb2e..79760b192c 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,13 @@ const assetStore = new AssetStore(assetStoreOptions); $effect(() => { + // Check to trigger rebuild the timeline when navigating between people from the info panel + const change = assetStoreOptions.personId !== data.person.id; assetStoreOptions.personId = data.person.id; handlePromiseError(assetStore.updateOptions(assetStoreOptions)); + if (change) { + assetStore.triggerUpdate(); + } }); const assetInteraction = new AssetInteraction();