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)
Thu, Oct 3, 11:06 AM
Unknown Object (File)
Thu, Oct 3, 12:08 AM
Unknown Object (File)
Tue, Sep 17, 11:50 AM
Unknown Object (File)
Tue, Sep 17, 11:50 AM
Unknown Object (File)
Tue, Sep 17, 11:50 AM
Unknown Object (File)
Tue, Sep 17, 11:47 AM
Unknown Object (File)
Sat, Sep 14, 8:58 PM
Unknown Object (File)
Aug 29 2024, 10:44 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