Page MenuHomePhabricator

D13521.diff
No OneTemporary

D13521.diff

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<boolean>(false);
-
- const coreFunctionality = React.useCallback(
+ return React.useCallback(
async (action: RelationshipAction, userIDs: $ReadOnlyArray<string>) => {
if (
action === relationshipActions.FRIEND ||
@@ -261,25 +259,6 @@
},
[updateRelationshipsAndSendRobotext, updateRelationships],
);
-
- return React.useCallback(
- async (action: RelationshipAction, userIDs: $ReadOnlyArray<string>) => {
- 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 };

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 12:17 AM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2508509
Default Alt Text
D13521.diff (1 KB)

Event Timeline