Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Don't show RBR on the LHN for transaction threads with violations if the report has already been reimbursed/settled #37767

Merged
Merged
7 changes: 6 additions & 1 deletion src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ function getOptionData({
const participantPersonalDetailList = Object.values(OptionsListUtils.getPersonalDetailsForAccountIDs(participantAccountIDs, personalDetails)) as PersonalDetails[];
const personalDetail = participantPersonalDetailList[0] ?? {};
const hasErrors = Object.keys(result.allReportErrors ?? {}).length !== 0;
let shouldHideViolation = false;
FitseTLT marked this conversation as resolved.
Show resolved Hide resolved
if (hasViolations && parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU) {
const {IOUReportID} = parentReportAction?.originalMessage ?? {};
shouldHideViolation = ReportUtils.isSettled(IOUReportID);
}

result.isThread = ReportUtils.isChatThread(report);
result.isChatRoom = ReportUtils.isChatRoom(report);
Expand All @@ -241,7 +246,7 @@ function getOptionData({
result.isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report);
result.shouldShowSubscript = ReportUtils.shouldReportShowSubscript(report);
result.pendingAction = report.pendingFields?.addWorkspaceRoom ?? report.pendingFields?.createChat;
result.brickRoadIndicator = hasErrors || hasViolations ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';
result.brickRoadIndicator = hasErrors || (hasViolations && !shouldHideViolation) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';
FitseTLT marked this conversation as resolved.
Show resolved Hide resolved
result.ownerAccountID = report.ownerAccountID;
result.managerID = report.managerID;
result.reportID = report.reportID;
Expand Down
Loading