fix(web): profile image load (#2434)

This commit is contained in:
Michel Heusschen 2023-05-13 16:16:14 +02:00 committed by GitHub
parent 4dff129949
commit 15fa8250cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 2 deletions

View file

@ -2,6 +2,7 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { clickOutside } from '$lib/utils/click-outside';
import { imageLoad } from '$lib/utils/image-load';
import { createEventDispatcher } from 'svelte';
import { fade, fly } from 'svelte/transition';
import TrayArrowUp from 'svelte-material-icons/TrayArrowUp.svelte';
@ -124,13 +125,13 @@
>
{#if user.profileImagePath}
<img
transition:fade={{ duration: 100 }}
class:hidden={showProfilePictureFallback}
src={`${$page.url.origin}/api/user/profile-image/${user.id}`}
alt="profile-img"
class="inline rounded-full h-12 w-12 object-cover shadow-md border-2 border-immich-primary hover:border-immich-dark-primary dark:hover:border-immich-primary dark:border-immich-dark-primary transition-all"
draggable="false"
on:load={() => (showProfilePictureFallback = false)}
use:imageLoad
on:image-load={() => (showProfilePictureFallback = false)}
/>
{/if}
{#if showProfilePictureFallback}