From 19e9908ee2195ed39306b464ebea043c61004b9d Mon Sep 17 00:00:00 2001 From: Russell Tan Date: Fri, 12 Jan 2024 12:27:34 -0800 Subject: [PATCH] fix(web): show description in shared links (#4249) * chore: rebase * fix: re-size issue --------- Co-authored-by: Jason Rasmussen --- .../asset-viewer/detail-panel.svelte | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) 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} -
-