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 = {