diff --git a/native/avatars/avatar-hooks.js b/native/avatars/avatar-hooks.js --- a/native/avatars/avatar-hooks.js +++ b/native/avatars/avatar-hooks.js @@ -288,9 +288,12 @@ return selectFromGalleryAndUpdateThreadAvatar; } -function useRemoveUserAvatar(): () => Promise { +function useRemoveUserAvatar(): [() => Promise, boolean] { const dispatchActionPromise = useDispatchActionPromise(); const updateUserAvatarCall = useServerCall(updateUserAvatar); + const updateUserAvatarLoadingStatus: LoadingStatus = useSelector( + updateUserAvatarLoadingStatusSelector, + ); const removeUserAvatar = React.useCallback(async () => { const removeAvatarRequest: UpdateUserAvatarRemoveRequest = { @@ -303,7 +306,10 @@ ); }, [dispatchActionPromise, updateUserAvatarCall]); - return removeUserAvatar; + return React.useMemo( + () => [removeUserAvatar, updateUserAvatarLoadingStatus === 'loading'], + [removeUserAvatar, updateUserAvatarLoadingStatus], + ); } function useRemoveThreadAvatar(threadID: string): () => Promise { diff --git a/native/avatars/edit-user-avatar.react.js b/native/avatars/edit-user-avatar.react.js --- a/native/avatars/edit-user-avatar.react.js +++ b/native/avatars/edit-user-avatar.react.js @@ -22,7 +22,7 @@ const [selectFromGalleryAndUpdateUserAvatar] = useSelectFromGalleryAndUpdateUserAvatar(); - const removeUserAvatar = useRemoveUserAvatar(); + const [removeUserAvatar] = useRemoveUserAvatar(); const actionSheetConfig = React.useMemo( () => [