mirror of
https://github.com/immich-app/immich.git
synced 2025-01-19 18:26:46 +01:00
fix(web): show description in shared links (#4249)
* chore: rebase * fix: re-size issue --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
df4af025d7
commit
19e9908ee2
1 changed files with 26 additions and 19 deletions
|
@ -54,16 +54,20 @@
|
||||||
|
|
||||||
$: isOwner = $user?.id === asset.ownerId;
|
$: isOwner = $user?.id === asset.ownerId;
|
||||||
|
|
||||||
$: {
|
const handleNewAsset = async (newAsset: AssetResponseDto) => {
|
||||||
|
description = newAsset?.exifInfo?.description || '';
|
||||||
|
|
||||||
// Get latest description from server
|
// Get latest description from server
|
||||||
if (asset.id && !api.isSharedLink) {
|
if (newAsset.id && !api.isSharedLink) {
|
||||||
api.assetApi.getAssetById({ id: asset.id }).then((res) => {
|
const { data } = await api.assetApi.getAssetById({ id: asset.id });
|
||||||
people = res.data?.people || [];
|
people = data?.people || [];
|
||||||
textarea.value = res.data?.exifInfo?.description || '';
|
description = data.exifInfo?.description || '';
|
||||||
autoGrowHeight();
|
textarea.value = description;
|
||||||
});
|
autoGrowHeight();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
$: handleNewAsset(asset);
|
||||||
|
|
||||||
$: latlng = (() => {
|
$: latlng = (() => {
|
||||||
const lat = asset.exifInfo?.latitude;
|
const lat = asset.exifInfo?.latitude;
|
||||||
|
@ -192,18 +196,21 @@
|
||||||
</section>
|
</section>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<section class="mx-4 mt-10" style:display={!isOwner && textarea?.value == '' ? 'none' : 'block'}>
|
<section class="mx-4 mt-10" style:display={!isOwner && description === '' ? 'none' : 'block'}>
|
||||||
<textarea
|
{#if !isOwner || api.isSharedLink}
|
||||||
bind:this={textarea}
|
<span>{description}</span>
|
||||||
class="max-h-[500px]
|
{:else}
|
||||||
|
<textarea
|
||||||
|
bind:this={textarea}
|
||||||
|
class="max-h-[500px]
|
||||||
w-full resize-none overflow-hidden border-b border-gray-500 bg-transparent text-base text-black outline-none transition-all focus:border-b-2 focus:border-immich-primary disabled:border-none dark:text-white dark:focus:border-immich-dark-primary"
|
w-full resize-none overflow-hidden border-b border-gray-500 bg-transparent text-base text-black outline-none transition-all focus:border-b-2 focus:border-immich-primary disabled:border-none dark:text-white dark:focus:border-immich-dark-primary"
|
||||||
placeholder={!isOwner ? '' : 'Add a description'}
|
placeholder={!isOwner ? '' : 'Add a description'}
|
||||||
on:focusin={handleFocusIn}
|
on:focusin={handleFocusIn}
|
||||||
on:focusout={handleFocusOut}
|
on:focusout={handleFocusOut}
|
||||||
on:input={autoGrowHeight}
|
on:input={autoGrowHeight}
|
||||||
bind:value={description}
|
bind:value={description}
|
||||||
disabled={!isOwner}
|
/>
|
||||||
/>
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{#if !api.isSharedLink && people.length > 0}
|
{#if !api.isSharedLink && people.length > 0}
|
||||||
|
|
Loading…
Reference in a new issue