Page MenuHomePhabricator

D8130.id27501.diff
No OneTemporary

D8130.id27501.diff

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

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)

Event Timeline