Page MenuHomePhabricator

D7528.diff
No OneTemporary

D7528.diff

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<void> {
+function useRemoveUserAvatar(): [() => Promise<void>, 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<void> {
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(
() => [

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 8:33 AM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579046
Default Alt Text
D7528.diff (1 KB)

Event Timeline