Page MenuHomePhabricator

D7645.diff
No OneTemporary

D7645.diff

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

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)

Event Timeline