From b6ec79cbddc3bdb9e638e4a59e2946ad0abe70ec Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:02:48 +0100 Subject: [PATCH] fix(web): timeline issues on person page (#14366) --- .../[[photos=photos]]/[[assetId=id]]/+page.svelte | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 502ce715bd6b6..48e194dda4728 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 @@ -63,14 +63,17 @@ data: PageData; } - let { data = $bindable() }: Props = $props(); + let { data }: Props = $props(); let numberOfAssets = $state(data.statistics.assets); let { isViewing: showAssetViewer } = assetViewingStore; - let assetStore = new AssetStore({ - isArchived: false, - personId: data.person.id, + const assetStoreOptions = { isArchived: false, personId: data.person.id }; + const assetStore = new AssetStore(assetStoreOptions); + + $effect(() => { + assetStoreOptions.personId = data.person.id; + handlePromiseError(assetStore.updateOptions(assetStoreOptions)); }); const assetInteractionStore = createAssetInteractionStore(); @@ -329,7 +332,6 @@ $effect(() => { if (person) { handlePromiseError(updateAssetCount()); - handlePromiseError(assetStore.updateOptions({ personId: person.id })); } });