-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 update image on account screen when updating profile image #7978
Conversation
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 finally caught up with this issue this evening so I went ahead and tested on the PR builds while I was poking around, and verified first that I was able to reproduce on iOS (Lindy repro'ed on Android), and then verified that the issue is fixed on both iOS and Android builds. 👍
Thanks for testing @lindalumitchell 🤗 |
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 posted a couple thoughts below, but this seems like it'll fix the issue regardless
@@ -56,7 +58,7 @@ const Image = ({author, forwardRef, iconSize, size, source, url}: Props) => { | |||
|
|||
const pictureUrl = buildProfileImageUrlFromUser(serverUrl, author); | |||
return source ?? {uri: buildAbsoluteUrl(serverUrl, pictureUrl)}; | |||
}, [author, serverUrl, source]); | |||
}, [author, serverUrl, source, lastPictureUpdateAt]); |
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's a bit concerning that this needs to be passed in separately since that sounds like author
is being mutated for it to not cause imgSource
to be updated
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.
Idk why is happening but yes I agree, i did not want to spend tons of time on this
@@ -56,7 +58,7 @@ const Image = ({author, forwardRef, iconSize, size, source, url}: Props) => { | |||
|
|||
const pictureUrl = buildProfileImageUrlFromUser(serverUrl, author); |
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.
To avoid someone potentially removing lastPictureUpdateAt
in the future because it's unused in the body of the useMemo
, you might want to change this to use buildProfileImageUrl
so that it explicitly uses lastPictureUpdateAt
in here
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.
Yes that is better, perhaps you can make that fhange @hmhealey and merge the PR as I'm already embracing the pillow :)
Cherry pick is scheduled. |
(cherry picked from commit 83e4aba)
#7983) (cherry picked from commit 83e4aba) Co-authored-by: Elias Nahum <[email protected]>
Summary
For some reason the
author
changes was not being picked up by the useMemo, now we are getting the last time the user updated the picture as part of the dependencies of the memo in order to trigger it and update the url of the profile picture.Ticket Link
https://mattermost.atlassian.net/browse/MM-58501
Release Note