Skip to content

Commit 19f93d1

Browse files
committed
fix: pass selector dependencies to useOnyx
1 parent ba04c09 commit 19f93d1

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/MoneyRequestConfirmationList/sections/InvoiceSenderField.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ function InvoiceSenderField({selectedParticipants, isReadOnly, didConfirm, iouTy
5656
const isFromGlobalCreate = !!transaction?.isFromGlobalCreate;
5757

5858
// canSendInvoice needs the full policy collection to check all admin workspaces
59-
const [canUpdateSenderWorkspace] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {
60-
selector: createCanUpdateSenderWorkspaceSelector(selectedParticipants, currentUserLogin, isFromGlobalCreate),
61-
});
59+
const [canUpdateSenderWorkspace] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: createCanUpdateSenderWorkspaceSelector(selectedParticipants, currentUserLogin, isFromGlobalCreate)}, [
60+
selectedParticipants,
61+
currentUserLogin,
62+
isFromGlobalCreate,
63+
]);
6264

6365
return (
6466
<MenuItem

src/components/MoneyRequestConfirmationList/sections/ReportField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function ReportField({selectedParticipants, iouType, reportID, reportActionID, a
5555
const reportAttributes = useReportAttributes();
5656
const policyID = selectedParticipants?.at(0)?.policyID;
5757
const [reportNameValuePairs] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS);
58-
const [outstandingReportsForPolicy] = useOnyx(ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID, {selector: createOutstandingReportsForPolicySelector(policyID)});
58+
const [outstandingReportsForPolicy] = useOnyx(ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID, {selector: createOutstandingReportsForPolicySelector(policyID)}, [policyID]);
5959

6060
// Per-key report subscriptions instead of full COLLECTION.REPORT
6161
const [transactionReportEntry] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`);

0 commit comments

Comments
 (0)