-
Notifications
You must be signed in to change notification settings - Fork 793
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(profile): prepend user.updated_at to avatar url #266
fix(profile): prepend user.updated_at to avatar url #266
Conversation
This gives GitPoint an additional chance of refreshing an updated profile picture Closes #265
@@ -86,8 +86,8 @@ export const UserProfile = ({ | |||
<ImageZoom | |||
uri={{ | |||
uri: initialUser.avatar_url | |||
? initialUser.avatar_url | |||
: user.avatar_url, | |||
? `${initialUser.avatar_url}&cache=${initialUser.updated_at}` |
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.
Although the param cache
could be called for example dateUpdate
(to make it more meaningful), but I would generally convert the date into a timestamp (+new Date(updated_at)
), so it was cleaner, but I think it is superfluous.
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.
I think lastModified
might be the best query name to use so it's as close as possible to the last-modified
header we would pass to the API.
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.
Changed to lastModified
.
@lex111 keeping the value as it is, as it's easier to read for debugging purpose
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.
Thanks for this @machour <3
You might have mentioned on Gitter that this is not enough? Does having updated_at
not always update if the user makes a change to their profile settings?
Gives GitPoint an additional chance of refreshing an updated profile picture
Close #265