Skip to content

Commit

Permalink
Revert "fix hold promoted action not showing in specific cases"
Browse files Browse the repository at this point in the history
This reverts commit 2f10c65.

revert hold changes
  • Loading branch information
cdOut committed Jul 4, 2024
1 parent 81e0783 commit b4a1a40
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
// 2. MoneyReport case
if (caseID === CASES.MONEY_REPORT) {
if (!reportActions || !transactionThreadReport?.parentReportActionID) {
return undefined;
return null;
}
return reportActions.find((action) => action.reportActionID === transactionThreadReport.parentReportActionID);
}
Expand Down Expand Up @@ -446,14 +446,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
? ReportActionsUtils.getOriginalMessage(requestParentReportAction)?.IOUTransactionID ?? ''
: '';

let holdReportAction: OnyxTypes.ReportAction | undefined;
if (caseID == CASES.MONEY_REQUEST) {
holdReportAction = parentReportAction;
} else if (caseID == CASES.MONEY_REPORT) {
holdReportAction = requestParentReportAction;
}
const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(holdReportAction);
const shouldShowHoldAction = (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);
const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(parentReportAction);
const shouldShowHoldAction =
caseID !== CASES.MONEY_REPORT && (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);

const canJoin = ReportUtils.canJoinChat(report, parentReportAction, policy);

Expand All @@ -465,7 +460,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
}

if (isExpenseReport && shouldShowHoldAction) {
result.push(PromotedActions.hold({isTextHold: canHoldUnholdReportAction.canHoldRequest, reportAction: holdReportAction}));
result.push(PromotedActions.hold({isTextHold: canHoldUnholdReportAction.canHoldRequest, reportAction: parentReportAction}));
}

if (report) {
Expand Down

0 comments on commit b4a1a40

Please sign in to comment.