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
Unknown Object (File)
Tue, Nov 5, 2:08 AM
Unknown Object (File)
Tue, Nov 5, 2:08 AM
Unknown Object (File)
Tue, Nov 5, 2:08 AM
Unknown Object (File)
Tue, Nov 5, 2:08 AM
Unknown Object (File)
Tue, Nov 5, 2:08 AM
Unknown Object (File)
Mon, Oct 28, 2:10 PM
Unknown Object (File)
Mon, Oct 28, 2:10 PM
Unknown Object (File)
Mon, Oct 28, 2:10 PM
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
No Lint Coverage
Unit
No Test Coverage

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