diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 05d5741725a8..055dab044ca3 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -892,11 +892,11 @@ function navigateToAndOpenReport( avatarUri?: string, avatarFile?: File | CustomRNImageManipulatorResult | undefined, optimisticReportID?: string, + isGroupChat = false, ) { let newChat: ReportUtils.OptimisticChatReport | EmptyObject = {}; let chat: OnyxEntry | EmptyObject = {}; const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins(userLogins); - const isGroupChat = participantAccountIDs.length > 1; // If we are not creating a new Group Chat then we are creating a 1:1 DM and will look for an existing chat if (!isGroupChat) { diff --git a/src/pages/NewChatConfirmPage.tsx b/src/pages/NewChatConfirmPage.tsx index f25233f9f568..82f67eb40c86 100644 --- a/src/pages/NewChatConfirmPage.tsx +++ b/src/pages/NewChatConfirmPage.tsx @@ -93,7 +93,7 @@ function NewChatConfirmPage({newGroupDraft, allPersonalDetails}: NewChatConfirmP } const logins: string[] = (newGroupDraft.participants ?? []).map((participant) => participant.login); - Report.navigateToAndOpenReport(logins, true, newGroupDraft.reportName ?? '', newGroupDraft.avatarUri ?? '', fileRef.current, optimisticReportID.current); + Report.navigateToAndOpenReport(logins, true, newGroupDraft.reportName ?? '', newGroupDraft.avatarUri ?? '', fileRef.current, optimisticReportID.current, true); }; const navigateBack = () => { @@ -144,9 +144,9 @@ function NewChatConfirmPage({newGroupDraft, allPersonalDetails}: NewChatConfirmP sections={[{title: translate('common.members'), data: sections}]} ListItem={InviteMemberListItem} onSelectRow={unselectOption} - showConfirmButton={selectedOptions.length > 1} + showConfirmButton={Boolean(selectedOptions.length)} confirmButtonText={translate('newChatPage.startGroup')} - onConfirm={selectedOptions.length > 1 ? createGroup : undefined} + onConfirm={createGroup} shouldHideListOnInitialRender={false} />