From 327159c2ae450eb8090e19d42ba9d057937a44e4 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:41:25 +0100 Subject: [PATCH] fix/profile-dont-wait-for-avatar (#12080) * fix/profile-dont-wait-for-avatar * Update apps/web/pages/settings/my-account/profile.tsx * Update apps/web/pages/settings/my-account/profile.tsx --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> --- apps/web/pages/settings/my-account/profile.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx index bfe82cdc27..7b1d873dd8 100644 --- a/apps/web/pages/settings/my-account/profile.tsx +++ b/apps/web/pages/settings/my-account/profile.tsx @@ -78,8 +78,8 @@ type FormValues = { bio: string; }; -const checkIfItFallbackImage = (fetchedImgSrc: string) => { - return fetchedImgSrc.endsWith(AVATAR_FALLBACK); +const checkIfItFallbackImage = (fetchedImgSrc?: string) => { + return !fetchedImgSrc || fetchedImgSrc.endsWith(AVATAR_FALLBACK); }; const ProfileView = () => { @@ -226,10 +226,11 @@ const ProfileView = () => { [ErrorCode.ThirdPartyIdentityProviderEnabled]: t("account_created_with_identity_provider"), }; - if (isLoading || !user || fetchedImgSrc === undefined) + if (isLoading || !user) { return ( ); + } const defaultValues = { username: user.username || "",