From 421c1fdc8f64d9a50b65ddd6daa6af63b02ad7e4 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Tue, 30 Apr 2024 12:42:20 +0200 Subject: [PATCH] Allow creating a group chat with a single member --- ios/Podfile.lock | 25 +++++-------------------- src/libs/actions/Report.ts | 2 +- src/pages/NewChatConfirmPage.tsx | 6 +++--- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0398bd3b1324..cf5c4bab5c75 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1380,25 +1380,10 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-quick-sqlite (8.0.6): - - glog - - hermes-engine - - RCT-Folly (= 2022.05.16.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen + - react-native-quick-sqlite (8.0.0-beta.2): + - React + - React-callinvoker - React-Core - - React-debug - - React-Fabric - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - react-native-release-profiler (0.1.6): - glog - hermes-engine @@ -2514,7 +2499,7 @@ SPEC CHECKSUMS: react-native-pdf: cd256a00b9d65cb1008dcca2792d7bfb8874838d react-native-performance: 1aa5960d005159f4ab20be15b44714b53b44e075 react-native-plaid-link-sdk: 93870f8cd1de8e0acca5cb5020188bdc94e15db6 - react-native-quick-sqlite: f7b9f578b8b3b608dc742240b0103faae5b61f63 + react-native-quick-sqlite: bcc7a7a250a40222f18913a97cd356bf82d0a6c4 react-native-release-profiler: 42fc8e09b4f6f9b7d14cc5a15c72165e871c0918 react-native-render-html: 96c979fe7452a0a41559685d2f83b12b93edac8c react-native-safe-area-context: e8bdd57d9f8d34cc336f0ee6acb30712a8454446 @@ -2572,7 +2557,7 @@ SPEC CHECKSUMS: SDWebImageWebPCoder: af09429398d99d524cae2fe00f6f0f6e491ed102 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2 - VisionCamera: 8c5c9c50b3d76018782a823cee2f0b8b628c8604 + VisionCamera: 3033e0dd5272d46e97bcb406adea4ae0e6907abf Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70 PODFILE CHECKSUM: a25a81f2b50270f0c0bd0aff2e2ebe4d0b4ec06d diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 34335c797212..462d0716a9e0 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?: boolean, ) { 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..fe12403ed288 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={selectedOptions.length > 0} confirmButtonText={translate('newChatPage.startGroup')} - onConfirm={selectedOptions.length > 1 ? createGroup : undefined} + onConfirm={selectedOptions.length > 0 ? createGroup : undefined} shouldHideListOnInitialRender={false} />