HomePhabricator
Diffusion Comm 40dd39566b8b

[native] have UserAvatar component also use currentUserInfo state

Description

[native] have UserAvatar component also use currentUserInfo state

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:

Reviewers: ashoat, atul

Reviewed By: ashoat

Subscribers: ashoat, tomek, atul

Differential Revision: https://phab.comm.dev/D7360

Details

Provenance
ginsuAuthored on Apr 12 2023, 3:36 PM
Reviewer
ashoat
Differential Revision
D7360: [native] have UserAvatar component also use currentUserInfo state
Parents
rCOMM54acb86ee883: [Tunnelbroker] Add message types for existing protobuf messages
Branches
Unknown
Tags
Unknown