Page MenuHomePhabricator

[native] Introduce RegistrationMode in EditUserAvatarProvider
ClosedPublic

Authored by ashoat on May 31 2023, 1:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 4, 9:09 PM
Unknown Object (File)
Thu, Apr 4, 9:09 PM
Unknown Object (File)
Thu, Apr 4, 9:09 PM
Unknown Object (File)
Thu, Apr 4, 9:01 PM
Unknown Object (File)
Feb 11 2024, 1:03 AM
Unknown Object (File)
Feb 11 2024, 1:03 AM
Unknown Object (File)
Feb 11 2024, 12:07 AM
Unknown Object (File)
Feb 10 2024, 10:45 PM
Subscribers

Details

Summary

A consumer of the EditUserAvatarContext will be able to call setRegistrationMode to override what happens when an avatar is successfully selected.

This will allow the registration flow to get the avatar info without needing to change much other code.

Test Plan

This was tested in combination with the rest of the stack. I tested:

  1. ENS flow, both when user has an ENS avatar and when they don't
  2. Setting an emoji avatar
  3. Setting an image avatar via camera
  4. Setting an image avatar via media library
  5. Tested avatar update flow after being logged in to make sure I didn't regress anything

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/avatars/edit-user-avatar-provider.react.js
108 ↗(On Diff #27319)

In D8017, I made setUserAvatar wait until the keyserver call completed before returning. Doing the same thing here since it allows callers to eg. display a loading spinner while the operation is happening. Current callers don't actually await the promise anyways

This revision is now accepted and ready to land.Jun 1 2023, 11:13 AM