Page MenuHomePhabricator

D4315.diff
No OneTemporary

D4315.diff

diff --git a/web/settings/relationship/add-users-list.react.js b/web/settings/relationship/add-users-list.react.js
--- a/web/settings/relationship/add-users-list.react.js
+++ b/web/settings/relationship/add-users-list.react.js
@@ -187,22 +187,22 @@
const callUpdateRelationships = useServerCall(updateRelationships);
const dispatchActionPromise = useDispatchActionPromise();
- const confirmSelection = React.useCallback(async () => {
- await dispatchActionPromise(
- updateRelationshipsActionTypes,
- callUpdateRelationships({
- action: relationshipAction,
- userIDs: Array.from(pendingUserIDs),
- }),
- );
+ const updateRelationshipsPromiseCreator = React.useCallback(async () => {
+ const result = await callUpdateRelationships({
+ action: relationshipAction,
+ userIDs: Array.from(pendingUserIDs),
+ });
closeModal();
- }, [
- callUpdateRelationships,
- dispatchActionPromise,
- closeModal,
- pendingUserIDs,
- relationshipAction,
- ]);
+ return result;
+ }, [callUpdateRelationships, closeModal, pendingUserIDs, relationshipAction]);
+ const confirmSelection = React.useCallback(
+ () =>
+ dispatchActionPromise(
+ updateRelationshipsActionTypes,
+ updateRelationshipsPromiseCreator(),
+ ),
+ [dispatchActionPromise, updateRelationshipsPromiseCreator],
+ );
const loadingStatus = useSelector(loadingStatusSelector);
let buttonContent = confirmButtonContent;
if (loadingStatus === 'loading') {

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 10:04 AM (21 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676705
Default Alt Text
D4315.diff (1 KB)

Event Timeline