Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/libs/ReportSecondaryActionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import {
hasOnlyNonReimbursableTransactions,
hasReportBeenReopened as hasReportBeenReopenedUtils,
hasReportBeenRetracted as hasReportBeenRetractedUtils,
isActionCreator,
isArchivedReport,
isAwaitingFirstLevelApproval,
isClosedReport as isClosedReportUtils,
Expand All @@ -68,6 +69,7 @@ import {
isInvoiceReport as isInvoiceReportUtils,
isIOUReport as isIOUReportUtils,
isMoneyRequestReportEligibleForMerge,
isOpenExpenseReport,
isOpenReport as isOpenReportUtils,
isPayer as isPayerUtils,
isProcessingReport as isProcessingReportUtils,
Expand Down Expand Up @@ -562,6 +564,11 @@ function isHoldActionForTransaction(
const iouOrExpenseReport = isExpenseReport || isIOUReport;
const holdReportAction = getReportAction(reportAction?.childReportID, `${reportTransaction?.comment?.hold ?? ''}`);
const {canHoldRequest} = canHoldUnholdReportAction(report, reportAction, holdReportAction, reportTransaction, policy, currentUserAccountID);
const isActionOwner = isActionCreator(reportAction);

if (isOpenExpenseReport(report)) {
return isActionOwner;
}

if (!iouOrExpenseReport || !canHoldRequest) {
return false;
Expand Down
6 changes: 6 additions & 0 deletions src/libs/actions/IOU/Hold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function putOnHold(
| typeof ONYXKEYS.COLLECTION.REPORT
| typeof ONYXKEYS.COLLECTION.REPORT_METADATA
| typeof ONYXKEYS.COLLECTION.NEXT_STEP
| typeof ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS
>
> = [
{
Expand Down Expand Up @@ -189,6 +190,11 @@ function putOnHold(
lastVisibleActionCreated: transactionThreadReport.lastVisibleActionCreated,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: transactionViolations,
},
];

// If the transaction thread report wasn't created before, we create it optimistically
Expand Down
Loading