From 9bfb4dfd069067b1c859b6ace6c8395a8a72adac Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:59:00 +0100 Subject: [PATCH] fix(web): loading profile image (#1803) --- .../navigation-bar/account-info-panel.svelte | 27 +++++++------- .../navigation-bar/navigation-bar.svelte | 36 +++++++++---------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte b/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte index b51fcb8fc7..d033c5d3ba 100644 --- a/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte +++ b/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte @@ -1,6 +1,6 @@
- + {/if} +

diff --git a/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte b/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte index 5a8606de70..348f7e1a3c 100644 --- a/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte +++ b/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte @@ -14,15 +14,12 @@ let shouldShowAccountInfo = false; + // Show fallback while loading profile picture and hide when image loads. + let showProfilePictureFallback = true; + const dispatch = createEventDispatcher(); let shouldShowAccountInfoPanel = false; - const getUserProfileImage = async () => { - if (!user.profileImagePath) { - return null; - } - return api.userApi.getProfileImage(user.id).catch(() => null); - }; const getFirstLetter = (text?: string) => { return text?.charAt(0).toUpperCase(); }; @@ -96,19 +93,20 @@ {#if shouldShowAccountInfo}