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
F3703211: D7621.id25875.diff
Tue, Jan 7, 8:00 PM
F3703210: D7621.id25870.diff
Tue, Jan 7, 8:00 PM
F3703209: D7621.id25745.diff
Tue, Jan 7, 8:00 PM
F3703208: D7621.id25706.diff
Tue, Jan 7, 8:00 PM
F3703207: D7621.id25724.diff
Tue, Jan 7, 8:00 PM
F3703206: D7621.id25721.diff
Tue, Jan 7, 8:00 PM
F3703196: D7621.id.diff
Tue, Jan 7, 8:00 PM
F3703189: D7621.diff
Tue, Jan 7, 7:55 PM
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
No Lint Coverage
Unit
No Test Coverage

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

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