Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3399072
D8130.id27501.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
D8130.id27501.diff
View Options
diff --git a/native/community-creation/community-creation-members.react.js b/native/community-creation/community-creation-members.react.js
--- a/native/community-creation/community-creation-members.react.js
+++ b/native/community-creation/community-creation-members.react.js
@@ -8,6 +8,7 @@
changeThreadSettingsActionTypes,
} from 'lib/actions/thread-actions.js';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
+import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
import {
userInfoSelectorForPotentialMembers,
userSearchIndexForPotentialMembers,
@@ -25,11 +26,11 @@
import CommunityCreationKeyserverLabel from './community-creation-keyserver-label.react.js';
import type { CommunityCreationNavigationProp } from './community-creation-navigator.react.js';
import RegistrationContainer from '../account/registration/registration-container.react.js';
+import { useNavigateToThread } from '../chat/message-list-types.js';
import LinkButton from '../components/link-button.react.js';
import { createTagInput } from '../components/tag-input.react.js';
import UserList from '../components/user-list.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
-import { ChatThreadListRouteName } from '../navigation/route-names.js';
import { useSelector } from '../redux/redux-utils.js';
export type CommunityCreationMembersScreenParams = {
@@ -79,6 +80,10 @@
[selectedUsers],
);
+ const navigateToThread = useNavigateToThread();
+ const threadInfos = useSelector(threadInfoSelector);
+ const communityThreadInfo = threadInfos[threadID];
+
const addSelectedUsersToCommunity = React.useCallback(() => {
dispatchActionPromise(
changeThreadSettingsActionTypes,
@@ -87,21 +92,22 @@
threadID,
changes: { newMemberIDs: selectedUserIDs },
});
- navigation.navigate(ChatThreadListRouteName);
+ navigateToThread({ threadInfo: communityThreadInfo });
return result;
})(),
);
}, [
callChangeThreadSettings,
+ communityThreadInfo,
dispatchActionPromise,
- navigation,
+ navigateToThread,
selectedUserIDs,
threadID,
]);
const exitCommunityCreationFlow = React.useCallback(() => {
- navigation.navigate(ChatThreadListRouteName);
- }, [navigation]);
+ navigateToThread({ threadInfo: communityThreadInfo });
+ }, [communityThreadInfo, navigateToThread]);
const activityIndicatorStyle = React.useMemo(
() => ({ paddingRight: 20 }),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 1:40 AM (20 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609693
Default Alt Text
D8130.id27501.diff (2 KB)
Attached To
Mode
D8130: [native] Navigate to newly created community after successful creation
Attached
Detach File
Event Timeline
Log In to Comment