Page MenuHomePhabricator

[native] have UserAvatar component also use currentUserInfo state
ClosedPublic

Authored by ginsu on Apr 7 2023, 12:27 PM.
Tags
None
Referenced Files
F2109572: D7360.id24831.diff
Tue, Jun 25, 4:53 PM
F2102644: D7360.id25063.diff
Tue, Jun 25, 1:04 AM
F2102378: D7360.diff
Tue, Jun 25, 12:14 AM
Unknown Object (File)
Fri, Jun 21, 11:08 AM
Unknown Object (File)
Fri, Jun 21, 4:20 AM
Unknown Object (File)
Thu, Jun 20, 11:51 PM
Unknown Object (File)
Thu, Jun 20, 10:23 PM
Unknown Object (File)
Thu, Jun 20, 11:19 AM
Subscribers

Details

Summary

In the past the UserAvatar component only fetched the userInfo from the redux user state store; however, we should also fetch from the currentUserInfo state if the userID prop equals the current user info id. This is because when we save an avatar, we only update the user avatar locally in redux in the currentUserInfo state not in the redux user state store.

Screenshot 2023-04-07 at 3.31.15 PM.png (1×1 px, 575 KB)

This was causing an issue where when we saved the avatar and then navigated back it would take a while for the current user avatar to update since it was only looking at redux user state store which will update when it eventually detects this inconsistency.

Test Plan

Please see the demo videos to see the changes I made:

Before (eventually the avatar will switch but it takes a few min):

After:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu retitled this revision from [native] have UserAvatar component use currentUserInfo state to [native] have UserAvatar component also use currentUserInfo state.Apr 7 2023, 12:39 PM
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: ashoat, atul.
ginsu edited the summary of this revision. (Show Details)
ginsu edited the summary of this revision. (Show Details)
ginsu requested review of this revision.Apr 7 2023, 12:43 PM
This revision is now accepted and ready to land.Apr 7 2023, 6:10 PM
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)

rebase before landing