Skip to content

Commit

Permalink
Merge pull request #41251 from rayane-djouah/Fix-User-invited-by-ment…
Browse files Browse the repository at this point in the history
…ioning-from-a-concierge-whisper-can't-see-parent-message

Fix: User invited by mentioning from a concierge whisper can't see parent message
  • Loading branch information
tylerkaraszewski authored Apr 30, 2024
2 parents 3a14704 + 0f9dc42 commit 33e73ef
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6185,16 +6185,21 @@ function getAllAncestorReportActions(report: Report | null | undefined): Ancesto
const parentReport = getReport(parentReportID);
const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '0');

if (!parentReportAction || ReportActionsUtils.isTransactionThread(parentReportAction) || !parentReport) {
if (!parentReportAction || ReportActionsUtils.isTransactionThread(parentReportAction)) {
break;
}

const isParentReportActionUnread = ReportActionsUtils.isCurrentActionUnread(parentReport, parentReportAction);
const isParentReportActionUnread = ReportActionsUtils.isCurrentActionUnread(parentReport ?? {}, parentReportAction);
allAncestors.push({
report: currentReport,
reportAction: parentReportAction,
shouldDisplayNewMarker: isParentReportActionUnread,
});

if (!parentReport) {
break;
}

parentReportID = parentReport?.parentReportID;
parentReportActionID = parentReport?.parentReportActionID;
if (!isEmptyObject(parentReport)) {
Expand Down Expand Up @@ -6224,13 +6229,17 @@ function getAllAncestorReportActionIDs(report: Report | null | undefined, includ
const parentReport = getReport(parentReportID);
const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '0');

if (!parentReportAction || (!includeTransactionThread && ReportActionsUtils.isTransactionThread(parentReportAction)) || !parentReport) {
if (!parentReportAction || (!includeTransactionThread && ReportActionsUtils.isTransactionThread(parentReportAction))) {
break;
}

allAncestorIDs.reportIDs.push(parentReportID ?? '');
allAncestorIDs.reportActionsIDs.push(parentReportActionID ?? '');

if (!parentReport) {
break;
}

parentReportID = parentReport?.parentReportID;
parentReportActionID = parentReport?.parentReportActionID;
}
Expand Down

0 comments on commit 33e73ef

Please sign in to comment.