Skip to content

Commit

Permalink
Allow creating a group chat with a single member
Browse files Browse the repository at this point in the history
  • Loading branch information
abzokhattab committed Apr 30, 2024
1 parent aee3a53 commit 421c1fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
25 changes: 5 additions & 20 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -2572,7 +2557,7 @@ SPEC CHECKSUMS:
SDWebImageWebPCoder: af09429398d99d524cae2fe00f6f0f6e491ed102
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2
VisionCamera: 8c5c9c50b3d76018782a823cee2f0b8b628c8604
VisionCamera: 3033e0dd5272d46e97bcb406adea4ae0e6907abf
Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70

PODFILE CHECKSUM: a25a81f2b50270f0c0bd0aff2e2ebe4d0b4ec06d
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,11 +892,11 @@ function navigateToAndOpenReport(
avatarUri?: string,
avatarFile?: File | CustomRNImageManipulatorResult | undefined,
optimisticReportID?: string,
isGroupChat?: boolean,
) {
let newChat: ReportUtils.OptimisticChatReport | EmptyObject = {};
let chat: OnyxEntry<Report> | 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) {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/NewChatConfirmPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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}
/>
</View>
Expand Down

0 comments on commit 421c1fd

Please sign in to comment.