Page MenuHomePhabricator

[native] move selecting from gallery logic from avatar hooks to edit user avatar provider
ClosedPublic

Authored by ginsu on Apr 25 2023, 12:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 2, 11:50 PM
Unknown Object (File)
Fri, Dec 27, 3:21 PM
Unknown Object (File)
Mon, Dec 23, 2:23 AM
Unknown Object (File)
Mon, Dec 9, 3:30 PM
Unknown Object (File)
Sun, Dec 8, 8:56 PM
Unknown Object (File)
Sun, Dec 8, 7:46 PM
Unknown Object (File)
Nov 24 2024, 5:41 AM
Unknown Object (File)
Nov 24 2024, 5:40 AM
Subscribers

Details

Summary

This diff moves the logic for setting an avatar using your photo gallery from avatar hooks to edit user avatar provider. This diff wraps up the introduction of introducing the edit user avatar provider

Depends on D7627

Test Plan

I tested all the avatar options we had (ENS, Emoji, and Photo gallery) and in all cases the behvaoir was to be expected with setting the avatar, loading while the avatar was saved

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Apr 25 2023, 1:16 PM
This revision now requires changes to proceed.Apr 25 2023, 1:25 PM
ginsu retitled this revision from [native] introduce edit user avatar provider to [native] move selecting from gallery logic from avatar hooks to edit user avatar provider.Apr 25 2023, 2:41 PM
ginsu edited the summary of this revision. (Show Details)
ginsu added inline comments.
native/avatars/edit-user-avatar-provider.react.js
82 ↗(On Diff #25721)

Only change here is changing the name from setProcessingOrUploadInProgress to setUserAvatarMediaUploadInProgress

fix import order

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

Only change here is changing the name from setProcessingOrUploadInProgress to setUserAvatarMediaUploadInProgress

ashoat requested changes to this revision.Apr 25 2023, 6:04 PM
ashoat added inline comments.
native/avatars/edit-user-avatar-provider.react.js
56–61 ↗(On Diff #25724)

We don't need this useMemo. Memoization is pretty much never worth doing when you're returning a primitive. The only reason would be for a really expensive calculation (rare)

86 ↗(On Diff #25724)

Avoid implicit return undefined and throw here

This revision now requires changes to proceed.Apr 25 2023, 6:04 PM
This revision is now accepted and ready to land.Apr 27 2023, 4:19 AM