Page MenuHomePhabricator

[native] introduce edit thread avatar provider
ClosedPublic

Authored by ginsu on Apr 26 2023, 4:15 AM.
Tags
None
Referenced Files
F2147426: D7629.diff
Sun, Jun 30, 2:00 AM
Unknown Object (File)
Sat, Jun 29, 9:58 AM
Unknown Object (File)
Thu, Jun 27, 6:40 PM
Unknown Object (File)
Thu, Jun 27, 6:40 PM
Unknown Object (File)
Thu, Jun 27, 6:40 PM
Unknown Object (File)
Thu, Jun 27, 6:40 PM
Unknown Object (File)
Thu, Jun 27, 6:40 PM
Unknown Object (File)
Thu, Jun 27, 6:40 PM
Subscribers

Details

Summary

In this diff I introduce the edit thread avatar provider and moved the remove user avatar functionality from the avatar-hooks to this provider. Future diffs will bring the other edit avatar functionality over to this provider.

Depends on D7624

Test Plan

Able to remove an avatar and the behavior is to be expected.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: ashoat, atul.
native/avatars/edit-thread-avatar-provider.react.js
39 ↗(On Diff #25755)

I initially tried using an invariant to make sure the NavContext was set; however, this caused the app to crash so a work around that I felt good with is to set the activeThreadID to an empty string whenever a user is not actively in a thread. I don't think this should cause any issues with this provider, since you can only edit a thread avatar whenever you are actively in a thread, so activeThreadID should always be set in those cases.

ginsu requested review of this revision.Apr 26 2023, 4:33 AM
This revision now requires changes to proceed.Apr 27 2023, 10:21 AM

split diff (this is the first part)

native/avatars/edit-thread-avatar-provider.react.js
50 ↗(On Diff #25898)

This was a change I had to do. Previously we would get threadID from the hook parameter, but now that we don't have the hook anymore we need to get threadID from this callback parameter

native/avatars/edit-thread-avatar.react.js
38–40 ↗(On Diff #25898)

Will simplify this

Thanks for making this a clean refactor diff!

This revision is now accepted and ready to land.Apr 27 2023, 6:09 PM
ginsu edited the test plan for this revision. (Show Details)

rebase before landing

This revision was landed with ongoing or failed builds.Apr 28 2023, 11:09 AM
This revision was automatically updated to reflect the committed changes.