HomePhabricator
Diffusion Comm 24e5fa169ea0

Move registrationMode-related logic from `setUserAvatar` to…

Description

Move registrationMode-related logic from setUserAvatar to nativeSetUserAvatar

Summary:
The registrationMode-related code is native-specific and was pretty interwoven with the logic in setUserAvatar/updateImageUserAvatar.

This diff begins to untangle the two and move registrationMode-related logic to native/.../avatar-hooks.js.

As of this diff, setUserAvatar(request: UpdateUserAvatarRequest) is fully platform-agnostic and can be used on both native (via nativeSetUserAvatar) and web (via upcoming webSetUserAvatar).


Depends on D8342

Test Plan:
As of D8341, all native codepaths go through nativeSetUserAvatar instead of setUserAvatar.

Continue to be able to set non-image avatars + remove avatars on both native and web as expected.

Reviewers: ashoat, ginsu, rohan

Reviewed By: ashoat, rohan

Subscribers: tomek

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