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