From fa62c00c310c928acfd59ceda2b56dd1e967e1a9 Mon Sep 17 00:00:00 2001 From: Hans Date: Wed, 31 May 2023 13:21:34 +0700 Subject: [PATCH] update the position of avatar check --- src/pages/home/report/ReportActionsView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 7ee1007bb045..1007eb55fc08 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -127,9 +127,6 @@ class ReportActionsView extends React.Component { } shouldComponentUpdate(nextProps, nextState) { - const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; - const nextPolicy = nextProps.policies[`${ONYXKEYS.COLLECTION.POLICY}${nextProps.report.policyID}`]; - if (!_.isEqual(nextProps.reportActions, this.props.reportActions)) { this.mostRecentIOUReportActionID = ReportActionsUtils.getMostRecentIOURequestActionID(nextProps.reportActions); return true; @@ -179,6 +176,9 @@ class ReportActionsView extends React.Component { return true; } + const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; + const nextPolicy = nextProps.policies[`${ONYXKEYS.COLLECTION.POLICY}${nextProps.report.policyID}`]; + if (lodashGet(policy, 'avatar') !== lodashGet(nextPolicy, 'avatar')) { return true; }