Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3242591
D12316.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12316.diff
View Options
diff --git a/web/invite-links/invite-link-handler.react.js b/web/invite-links/invite-link-handler.react.js
--- a/web/invite-links/invite-link-handler.react.js
+++ b/web/invite-links/invite-link-handler.react.js
@@ -7,9 +7,12 @@
verifyInviteLinkActionTypes,
} from 'lib/actions/link-actions.js';
import { useModalContext } from 'lib/components/modal-provider.react.js';
+import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
import { isLoggedIn } from 'lib/selectors/user-selectors.js';
-import { getKeyserverOverrideForAnInviteLink } from 'lib/shared/invite-links.js';
-import type { KeyserverOverride } from 'lib/shared/invite-links.js';
+import {
+ getKeyserverOverrideForAnInviteLink,
+ type KeyserverOverride,
+} from 'lib/shared/invite-links.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
@@ -58,6 +61,7 @@
}, [dispatch, inviteSecret, loggedIn, pushModal]);
const validateLink = useVerifyInviteLink(keyserverOverride);
+ const threadInfos = useSelector(threadInfoSelector);
React.useEffect(() => {
const secret = inviteLinkSecret.current;
if (keyserverOverride === undefined || !secret) {
@@ -82,6 +86,22 @@
};
}
+ const communityID = result.community?.id;
+ if (
+ communityID &&
+ result.status === 'already_joined' &&
+ threadInfos[communityID]
+ ) {
+ dispatch({
+ type: updateNavInfoActionType,
+ payload: {
+ chatMode: 'view',
+ activeChatThreadID: communityID,
+ tab: 'chat',
+ },
+ });
+ }
+
pushModal(
<AcceptInviteModal
verificationResponse={result}
@@ -90,7 +110,14 @@
/>,
);
})();
- }, [dispatchActionPromise, keyserverOverride, pushModal, validateLink]);
+ }, [
+ dispatch,
+ dispatchActionPromise,
+ keyserverOverride,
+ pushModal,
+ threadInfos,
+ validateLink,
+ ]);
return null;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 11:37 PM (3 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2492899
Default Alt Text
D12316.diff (2 KB)
Attached To
Mode
D12316: [web] Open a community when a user clicks an invite link and is already a member
Attached
Detach File
Event Timeline
Log In to Comment