Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3263811
D13521.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13521.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13521: [lib] Allow multiple simultaneous calls to useUpdateRelationships from a single component
Attached
Detach File
Event Timeline
Log In to Comment