diff --git a/web/settings/relationship/add-users-list-modal.react.js b/web/settings/relationship/add-users-list-modal.react.js --- a/web/settings/relationship/add-users-list-modal.react.js +++ b/web/settings/relationship/add-users-list-modal.react.js @@ -45,6 +45,10 @@ relationshipAction, } = props; + const [pendingUsersToAdd, setPendingUsersToAdd] = React.useState< + $ReadOnlySet, + >(new Set()); + const [errorMessage, setErrorMessage] = React.useState(''); const addUsersListChildGenerator = React.useCallback( @@ -52,10 +56,12 @@ ), - [excludedStatuses, errorMessage], + [excludedStatuses, pendingUsersToAdd, errorMessage], ); const callUpdateRelationships = @@ -68,7 +74,7 @@ setErrorMessage(''); const result = await callUpdateRelationships({ action: relationshipAction, - userIDs: [], // TODO: re-add pending users + userIDs: Array.from(pendingUsersToAdd), }); closeModal(); return result; @@ -76,7 +82,12 @@ setErrorMessage('unknown error'); throw e; } - }, [callUpdateRelationships, closeModal, relationshipAction]); + }, [ + callUpdateRelationships, + relationshipAction, + pendingUsersToAdd, + closeModal, + ]); const confirmSelection = React.useCallback( () => @@ -104,8 +115,7 @@ return (