diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index 7d149e2cf6..8c61acb17b 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -54,16 +54,20 @@ $: isOwner = $user?.id === asset.ownerId; - $: { + const handleNewAsset = async (newAsset: AssetResponseDto) => { + description = newAsset?.exifInfo?.description || ''; + // Get latest description from server - if (asset.id && !api.isSharedLink) { - api.assetApi.getAssetById({ id: asset.id }).then((res) => { - people = res.data?.people || []; - textarea.value = res.data?.exifInfo?.description || ''; - autoGrowHeight(); - }); + if (newAsset.id && !api.isSharedLink) { + const { data } = await api.assetApi.getAssetById({ id: asset.id }); + people = data?.people || []; + description = data.exifInfo?.description || ''; + textarea.value = description; + autoGrowHeight(); } - } + }; + + $: handleNewAsset(asset); $: latlng = (() => { const lat = asset.exifInfo?.latitude; @@ -192,18 +196,21 @@ {/if} -
-