Skip to content

Commit

Permalink
refactor conditional and remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
cdOut committed Jun 24, 2024
1 parent c5d8cbb commit 080b27a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,17 +441,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
? ReportActionsUtils.getOriginalMessage(requestParentReportAction)?.IOUTransactionID ?? ''
: '';

const isSettled = ReportUtils.isSettled(moneyRequestReport?.reportID);
const isApproved = ReportUtils.isReportApproved(moneyRequestReport);

const canHoldUnholdReportAction = ReportUtils.canHoldUnholdReportAction(parentReportAction);
const shouldShowHoldAction =
caseID !== CASES.MONEY_REPORT &&
(canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) &&
!isSettled &&
!isApproved &&
!isDeletedParentAction &&
!ReportUtils.isArchivedRoom(parentReport);
caseID !== CASES.MONEY_REPORT && (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);

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

Expand Down

0 comments on commit 080b27a

Please sign in to comment.