Skip to content

Commit a685f91

Browse files
fix lint
1 parent 75e0fab commit a685f91

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/pages/iou/request/step/IOURequestEditReport.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ function IOURequestEditReport({route}: IOURequestEditReportProps) {
6161
// transactions, use the policy of their report (or the transaction's policy as fallback) so the
6262
// selected workspace is preserved.
6363
// For the current user's own non-per-diem expenses, fall back to undefined to let the default workspace apply.
64-
const isNotOwnerOrHasPerDiem = selectedReport?.ownerAccountID !== session?.accountID || hasPerDiemTransactions;
65-
const targetExpensePolicyID = isNotOwnerOrHasPerDiem ? selectedReport?.policyID : undefined;
64+
const isOwnedByOther = selectedReport?.ownerAccountID !== session?.accountID;
65+
const isOwnedByOtherOrHasPerDiem = isOwnedByOther || hasPerDiemTransactions;
66+
const targetExpensePolicyID = isOwnedByOtherOrHasPerDiem ? selectedReport?.policyID : undefined;
6667
const {policyForMovingExpensesID, shouldSelectPolicy} = usePolicyForMovingExpenses(hasPerDiemTransactions, undefined, targetExpensePolicyID);
6768
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
6869
const hasViolations = hasViolationsReportUtils(undefined, transactionViolations, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? '');

0 commit comments

Comments
 (0)