Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
waterim committed Mar 14, 2024
1 parent 0d9f7a2 commit 1443b26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,6 @@ const CONST = {
ADMIN: 'admin',
AUDITOR: 'auditor',
USER: 'user',
MEMBER: 'member',
},
AUTO_REPORTING_FREQUENCIES: {
INSTANT: 'instant',
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4278,7 +4278,8 @@ function getChatByParticipants(newParticipantList: number[], reports: OnyxCollec
isTaskReport(report) ||
isMoneyRequestReport(report) ||
isChatRoom(report) ||
isPolicyExpenseChat(report)
isPolicyExpenseChat(report) ||
isGroupChat(report)
) {
return false;
}
Expand Down
12 changes: 5 additions & 7 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1653,13 +1653,11 @@ function createSplitsAndOnyxData(
const currentUserEmailForIOUSplit = PhoneNumber.addSMSDomainIfPhoneNumber(currentUserLogin);
const participantAccountIDs = participants.map((participant) => Number(participant.accountID));

const existingSplitChatReport =
// eslint-disable-next-line no-nested-ternary
existingSplitChatReportID || participants[0].reportID
? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${existingSplitChatReportID || participants[0].reportID}`]
: participants.length < 2
? ReportUtils.getChatByParticipants(participantAccountIDs)
: null;
const existingChatReportID = existingSplitChatReportID || participants[0].reportID;
let existingSplitChatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${existingChatReportID}`];
if (!existingSplitChatReport) {
existingSplitChatReport = participants.length < 2 ? ReportUtils.getChatByParticipants(participantAccountIDs) : null;
}
const splitChatReport = existingSplitChatReport ?? ReportUtils.buildOptimisticChatReport(participantAccountIDs);
const isOwnPolicyExpenseChat = !!splitChatReport.isOwnPolicyExpenseChat;

Expand Down

0 comments on commit 1443b26

Please sign in to comment.