-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Avatar is not visible when the profile is disabled but the Avatar is set to public #568
Conversation
modifier = Modifier.padding(top = 16.dp), | ||
avatarCacheBuster = uiState.avatarCacheBuster, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't have to use the cache buster on this page, but:
- it makes testing easier, and
- it makes sure the the QE always shows the latest and correct avatar
@@ -144,11 +151,70 @@ private fun EmptyAvatar(size: Dp, modifier: Modifier = Modifier) { | |||
private fun Avatar(model: Any?, size: Dp, modifier: Modifier) { | |||
AsyncImage( | |||
model = model, | |||
contentDescription = "User profile image", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was hardcoded in the component, we could probably skip the waiting for the translation for this one, as it will delay the release again.
📲 You can test the changes from this Pull Request in Gravatar Demo by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works! Code changes LGTM too.
Closes #567
Description
This PR adjusts the
ProfileCard
component in the QuickEditor to show the Avatar when it's set to public even if the profile is set to private.To accomplish this I had to create a new
Avatar
component that takes theEmail
and not theComponentState
. It now relies on the Coil callback to show either the Loading or Error state. Loading is for the Skeleton and the Error is for the empty avatar image. Here's how it looks now with a private profile:This won't be the default behavior of all the Profile cards from the
:ui
module though, due to theComponentState
- we can only get the email from the profile once it's loaded, and at that point, this is a bit late. Even if we wanted to fall back when a profile can't be loaded (ComponentState.Empty) we wouldn't have any profile information. So that would require some API updates.Testing Steps
public profile
but keep the avatar publicpublic avatar
settings