-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Part 3b] Pass policyTags to getOptionData #83022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e13f0ec
5ac02c3
c04820b
8d66d9a
78d3ab0
55b5d7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import {deepEqual} from 'fast-equals'; | ||
| import React, {useMemo, useRef} from 'react'; | ||
| import {useCurrentReportIDState} from '@hooks/useCurrentReportID'; | ||
| import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; | ||
| import useGetExpensifyCardFromReportAction from '@hooks/useGetExpensifyCardFromReportAction'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import usePrevious from '@hooks/usePrevious'; | ||
|
|
@@ -53,6 +54,8 @@ function OptionRowLHNData({ | |
| const [movedFromReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.FROM)}`); | ||
| const [movedToReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.TO)}`); | ||
| const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); | ||
| const {login} = useCurrentUserPersonalDetails(); | ||
| const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${fullReport?.policyID}`); | ||
| // Check the report errors equality to avoid re-rendering when there are no changes | ||
| const prevReportErrors = usePrevious(reportAttributes?.reportErrors); | ||
| const areReportErrorsEqual = useMemo(() => deepEqual(prevReportErrors, reportAttributes?.reportErrors), [prevReportErrors, reportAttributes?.reportErrors]); | ||
|
|
@@ -82,6 +85,8 @@ function OptionRowLHNData({ | |
| movedToReport, | ||
| currentUserAccountID, | ||
| reportAttributesDerived, | ||
| policyTags, | ||
| currentUserLogin: login, | ||
|
Comment on lines
+88
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| }); | ||
| if (deepEqual(item, optionItemRef.current)) { | ||
| return optionItemRef.current; | ||
|
|
@@ -123,6 +128,8 @@ function OptionRowLHNData({ | |
| movedToReport, | ||
| currentUserAccountID, | ||
| reportAttributesDerived, | ||
| policyTags, | ||
| login, | ||
| ]); | ||
|
|
||
| return ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.