Skip to content
Merged
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
3 changes: 1 addition & 2 deletions src/libs/TransactionUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
};

let deprecatedAllReports: OnyxCollection<Report> = {};
Onyx.connect({

Check warning on line 129 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -135,7 +135,7 @@
});

let deprecatedAllTransactionViolations: OnyxCollection<TransactionViolations> = {};
Onyx.connect({

Check warning on line 138 in src/libs/TransactionUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => (deprecatedAllTransactionViolations = value),
Expand Down Expand Up @@ -1428,14 +1428,13 @@
const isSubmitter = isCurrentUserSubmitter(iouReport);
const isPolicyMember = isPolicyMemberPolicyUtils(policy, currentUserEmail);
const isReportOpen = isOpenExpenseReport(iouReport);
const isOpenOrProcessingReport = isReportOpen || isProcessingReport(iouReport);

if (violationName === CONST.VIOLATIONS.AUTO_REPORTED_REJECTED_EXPENSE) {
return isSubmitter || isPolicyAdmin(policy);
}

if (violationName === CONST.VIOLATIONS.OVER_AUTO_APPROVAL_LIMIT) {
return isPolicyAdmin(policy) && !isSubmitter && isOpenOrProcessingReport;
return isPolicyAdmin(policy) && !isSubmitter && isProcessingReport(iouReport);
}

if (violationName === CONST.VIOLATIONS.RTER) {
Expand Down
Loading