Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3245307
D7645.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7645.diff
View Options
diff --git a/native/avatars/edit-thread-avatar-provider.react.js b/native/avatars/edit-thread-avatar-provider.react.js
--- a/native/avatars/edit-thread-avatar-provider.react.js
+++ b/native/avatars/edit-thread-avatar-provider.react.js
@@ -80,13 +80,8 @@
updateThreadAvatarMediaUploadInProgress,
);
- const selectFromGalleryAndUpdateThreadAvatar = React.useCallback(
- async (threadID: string) => {
- const selection: ?MediaLibrarySelection = await selectFromGallery();
- if (!selection) {
- return;
- }
-
+ const updateImageThreadAvatar = React.useCallback(
+ async (selection: MediaLibrarySelection, threadID: string) => {
const imageAvatarUpdateRequest = await uploadSelectedMedia(selection);
if (!imageAvatarUpdateRequest) {
@@ -125,6 +120,17 @@
],
);
+ const selectFromGalleryAndUpdateThreadAvatar = React.useCallback(
+ async (threadID: string) => {
+ const selection: ?MediaLibrarySelection = await selectFromGallery();
+ if (!selection) {
+ return;
+ }
+ await updateImageThreadAvatar(selection, threadID);
+ },
+ [updateImageThreadAvatar],
+ );
+
const removeThreadAvatar = React.useCallback(
(threadID: string) => {
const removeAvatarRequest: UpdateUserAvatarRemoveRequest = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 5:53 PM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2494961
Default Alt Text
D7645.diff (1 KB)
Attached To
Mode
D7645: [native] improve factoring out redundant logic for saving an image thread avatar
Attached
Detach File
Event Timeline
Log In to Comment