Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3368164
D13000.id43182.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
D13000.id43182.diff
View Options
diff --git a/lib/shared/community-utils.js b/lib/shared/community-utils.js
--- a/lib/shared/community-utils.js
+++ b/lib/shared/community-utils.js
@@ -32,6 +32,7 @@
import type { ThreadSubscription } from '../types/subscription-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
+import type { ThreadJoinPayload } from '../types/thread-types.js';
import { useCurrentUserFID } from '../utils/farcaster-utils.js';
import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useDispatch, useSelector } from '../utils/redux-utils.js';
@@ -324,9 +325,14 @@
}
}, [isAuthenticated, ongoingJoinData, setStep, step]);
+ const threadJoinPromiseRef = React.useRef<?Promise<ThreadJoinPayload>>(null);
React.useEffect(() => {
void (async () => {
- if (!ongoingJoinData || step !== 'join_community') {
+ if (
+ !ongoingJoinData ||
+ step !== 'join_community' ||
+ threadJoinPromiseRef.current
+ ) {
return;
}
const communityThreadID = ongoingJoinData.communityID;
@@ -344,6 +350,7 @@
inviteLinkSecret: inviteSecret,
defaultSubscription,
});
+ threadJoinPromiseRef.current = joinThreadPromise;
void dispatchActionPromise(joinThreadActionTypes, joinThreadPromise);
try {
@@ -355,6 +362,8 @@
);
ongoingJoinData.reject();
setOngoingJoinData(null);
+ } finally {
+ threadJoinPromiseRef.current = null;
}
})();
}, [
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 6:29 PM (17 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585754
Default Alt Text
D13000.id43182.diff (1 KB)
Attached To
Mode
D13000: [lib] Make sure we send only one join thread request at a time
Attached
Detach File
Event Timeline
Log In to Comment