Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix profile cover loading flash

Anand Baburajan1c10992d0431
diff --git a/web/apps/space/src/screens/ProfileScreen.tsx b/web/apps/space/src/screens/ProfileScreen.tsx
index bc7e9b9001..57f7ad3312 100644
--- a/web/apps/space/src/screens/ProfileScreen.tsx
+++ b/web/apps/space/src/screens/ProfileScreen.tsx
@@ -591,7 +591,9 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
isPostsLoading && (showPostLoadingIndicator ?? true);
const shouldShowPostGrid =
hasProfilePosts || shouldShowPostLoadingIndicator;
- const isCoverImageLoading = Boolean(coverUrl && loadedCoverUrl != coverUrl);
+ const isCoverImageLoading = Boolean(
+ coverImageUrl && loadedCoverUrl != coverImageUrl,
+ );
const shouldShowCoverSkeleton =
isCoverLoading || isCoverURLPending || isCoverImageLoading;
const selectedPostActionMode: SpaceViewerPostActionMode = isOwnerProfile
@@ -1075,9 +1077,7 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
component="img"
alt=""
src={coverImageUrl}
- onLoad={() => {
- if (coverUrl) setLoadedCoverUrl(coverUrl);
- }}
+ onLoad={() => setLoadedCoverUrl(coverImageUrl)}
sx={{
display: "block",
height: "100%",