Skip to content

Commit

Permalink
Fixes to address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
x24git committed Oct 16, 2024
1 parent c4ceaea commit df65197
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
class="flex w-[calc(100%-3rem)] justify-end gap-2 overflow-hidden text-white"
data-testid="asset-viewer-navbar-actions"
>
{#if asset.owner && asset.owner.id != $user.id}
{#if asset.owner && asset.owner.id !== $user.id}
<div class="p-3 margin:auto">
<UserAvatar user={asset.owner} size="xs"></UserAvatar>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/components/asset-viewer/detail-panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
</div>
{/if}

{#if (asset.ownerId != $user?.id && asset.owner) || ($user === undefined && asset.owner)}
{#if (asset.owner && asset.ownerId != $user?.id) || $user === undefined}
<section class="px-6 dark:text-immich-dark-fg mt-4">
{#if currentAlbum}
<p class="text-sm">{$t('shared_by').toUpperCase()}</p>
Expand Down
18 changes: 8 additions & 10 deletions web/src/lib/components/assets/thumbnail/thumbnail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
let intersecting = false;
let lastRetrievedElement: HTMLElement | undefined;
let loaded = false;
let shareUser: UserResponseDto | undefined;
$: if (!retrieveElement) {
lastRetrievedElement = undefined;
Expand All @@ -89,9 +88,6 @@
lastRetrievedElement = element;
onRetrieveElement?.(element);
}
$: if ($showUserThumbnails && showUserThumbnailsinViewer && (isSharedLink() || asset.ownerId != $user.id)) {
handlePromiseError(getShareUser());
}
$: width = thumbnailSize || thumbnailWidth || 235;
$: height = thumbnailSize || thumbnailHeight || 235;
Expand Down Expand Up @@ -171,9 +167,9 @@
const getShareUser = async () => {
try {
shareUser = await getUserAndCacheResult(asset.ownerId);
return await getUserAndCacheResult(asset.ownerId);
} catch (error) {
handleError(error, $t('errors.unable_to_load_liked_status'));
handleError(error, $t('errors.unable_to_load_items'));
}
};
Expand Down Expand Up @@ -286,10 +282,12 @@
</div>
{/if}

{#if shareUser && showUserThumbnailsinViewer}
<div class="absolute bottom-2 left-2 z-10">
<UserAvatar user={shareUser} size="sm" />
</div>
{#if showUserThumbnailsinViewer && $showUserThumbnails && (isSharedLink() || asset.ownerId != $user.id)}
{#await getShareUser() then shareUser}
<div class="absolute bottom-2 left-2 z-10">
<UserAvatar user={shareUser} size="sm" />
</div>
{/await}
{/if}

{#if !isSharedLink() && showArchiveIcon && asset.isArchived}
Expand Down
4 changes: 2 additions & 2 deletions web/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@
"show_supporter_badge": "Supporter badge",
"show_supporter_badge_description": "Show a supporter badge",
"show_user_thumbnails": "Show user thumbnails",
"show_user_thumbnails_description": "Show user avatars on timelinle for shared albums and partners",
"show_user_thumbnails_description": "Show user avatars on timeline for shared albums and partners",
"shuffle": "Shuffle",
"sidebar": "Sidebar",
"sidebar_display_description": "Display a link to the view in the sidebar",
Expand Down Expand Up @@ -1309,4 +1309,4 @@
"yes": "Yes",
"you_dont_have_any_shared_links": "You don't have any shared links",
"zoom_image": "Zoom Image"
}
}

0 comments on commit df65197

Please sign in to comment.