diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 223606dc30c3..1c0049b6ea9b 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -246,6 +246,9 @@ class ReportScreen extends React.Component { const shouldAnimate = !shouldFreeze; const parentReportAction = ReportActionsUtils.getParentReportAction(this.props.report); const isSingleTransactionView = ReportActionsUtils.isTransactionThread(parentReportAction); + + const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; + return ( )} diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index a2b5d32b8d27..7336b78b48e3 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -38,6 +38,15 @@ const propTypes = { /** Information about the network */ network: networkPropTypes.isRequired, + /** The policy object for the current route */ + policy: PropTypes.shape({ + /** The name of the policy */ + name: PropTypes.string, + + /** The URL for the policy avatar */ + avatar: PropTypes.string, + }), + ...windowDimensionsPropTypes, ...withDrawerPropTypes, ...withLocalizePropTypes, @@ -45,6 +54,7 @@ const propTypes = { const defaultProps = { reportActions: [], + policy: null, }; class ReportActionsView extends React.Component { @@ -169,6 +179,14 @@ class ReportActionsView extends React.Component { return true; } + if (lodashGet(this.props, 'policy.avatar') !== lodashGet(nextProps, 'policy.avatar')) { + return true; + } + + if (lodashGet(this.props, 'policy.name') !== lodashGet(nextProps, 'policy.name')) { + return true; + } + return !_.isEqual(lodashGet(this.props.report, 'icons', []), lodashGet(nextProps.report, 'icons', [])); }