Skip to content

Commit

Permalink
pass transactionThreadReportID from ReportScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkiWines committed Mar 28, 2024
1 parent 7dd2384 commit fec3aa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ function ReportScreen({
isLoadingNewerReportActions={reportMetadata?.isLoadingNewerReportActions}
isLoadingOlderReportActions={reportMetadata?.isLoadingOlderReportActions}
isReadyForCommentLinking={!shouldShowSkeleton}
transactionThreadReportID={ReportActionsUtils.getOneTransactionThreadReportID(reportActions ?? [])}
/>
)}

Expand Down
14 changes: 6 additions & 8 deletions src/pages/home/report/ReportActionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ type ReportActionsViewProps = ReportActionsViewOnyxProps & {

/** Whether the report is ready for comment linking */
isReadyForCommentLinking?: boolean;

/** The reportID of the transaction thread report associated with this current report, if any */
// eslint-disable-next-line react/no-unused-prop-types
transactionThreadReportID?: string | null;
};

const DIFF_BETWEEN_SCREEN_HEIGHT_AND_LIST = 120;
Expand Down Expand Up @@ -541,18 +545,12 @@ export default Performance.withRenderTrace({id: '<ReportActionsView> rendering'}
key: ONYXKEYS.SESSION,
},
transactionThreadReportActions: {
key: ({reportActions}) => {
const transactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(reportActions ?? []);
return `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`;
},
key: ({transactionThreadReportID}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
canEvict: false,
selector: (reportActions: OnyxEntry<OnyxTypes.ReportActions>) => ReportActionsUtils.getSortedReportActionsForDisplay(reportActions, true),
},
transactionThreadReport: {
key: ({reportActions}) => {
const transactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(reportActions ?? []);
return `${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`;
},
key: ({transactionThreadReportID}) => `${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`,
},
})(MemoizedReportActionsView),
);

0 comments on commit fec3aa3

Please sign in to comment.