diff --git a/lib/hooks/relationship-hooks.js b/lib/hooks/relationship-hooks.js --- a/lib/hooks/relationship-hooks.js +++ b/lib/hooks/relationship-hooks.js @@ -228,9 +228,7 @@ ], ); - const [inProgress, setInProgress] = React.useState(false); - - const coreFunctionality = React.useCallback( + return React.useCallback( async (action: RelationshipAction, userIDs: $ReadOnlyArray) => { if ( action === relationshipActions.FRIEND || @@ -261,25 +259,6 @@ }, [updateRelationshipsAndSendRobotext, updateRelationships], ); - - return React.useCallback( - async (action: RelationshipAction, userIDs: $ReadOnlyArray) => { - if (inProgress) { - console.log( - 'updateRelationships called from same component before last call ' + - 'finished. ignoring', - ); - return {}; - } - setInProgress(true); - try { - return await coreFunctionality(action, userIDs); - } finally { - setInProgress(false); - } - }, - [inProgress, coreFunctionality], - ); } export { useUpdateRelationships };