Page MenuHomePhabricator

D7528.id25387.diff
No OneTemporary

D7528.id25387.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, 10:22 AM (19 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579046
Default Alt Text
D7528.id25387.diff (1 KB)

Event Timeline