Page MenuHomePhabricator

[native] Introduce naive `useSelectFromGalleryAndUpdateThreadAvatar` hook
ClosedPublic

Authored by atul on Apr 18 2023, 7:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 3:19 AM
Unknown Object (File)
Wed, Nov 27, 5:37 AM
Unknown Object (File)
Mon, Nov 25, 12:46 PM
Unknown Object (File)
Wed, Nov 6, 3:30 AM
Unknown Object (File)
Mon, Nov 4, 11:22 PM
Unknown Object (File)
Mon, Nov 4, 11:22 PM
Unknown Object (File)
Mon, Nov 4, 11:21 PM
Unknown Object (File)
Mon, Nov 4, 8:52 AM
Subscribers

Details

Summary
NOTE: This is largely copy/pasted from D7510. Putting this up so we can avoid using useSelectFromGalleryAndUpdateUserAvatar in EditThreadAvatar (as we're doing in D7510) and to potentially unblock @ginsu's camera work. I'm totally aware there's duplicated code between useSelectFromGalleryAndUpdateUserAvatar and useSelectFromGalleryAndUpdateThreadAvatar. I'm currently working on error handling/displaying status+progress with useSelectFromGalleryAndUpdateUserAvatar. Once I'm done with that I'll take another look to see what functionality can be consolidated between useSelectFromGalleryAndUpdateUserAvatar and useSelectFromGalleryAndUpdateThreadAvatar.

This hook composes together the previously created image avatar-related hooks (eg useProcessSelectedMedia, useUploadProcessedMedia, etc) to

  1. Display the system image picker so user can select image
  2. Process the selected image
  3. Upload the processed image
  4. Update the thread avatar with the threadID of the thread and uploadID of the uploaded processed image.

There's still work to be done in terms of displaying status/progress, handling erorrs, etc... but this diff gets things working "end to end." Putting it up now to unblock @ginsu's camera work.


Depends on D7510

Test Plan

Able to successfully set image avatar for thread:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable