Skip to content

Commit

Permalink
Merge pull request Expensify#20243 from hoangzinh/df/19788
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous authored Jun 7, 2023
2 parents d55f25e + 11d838d commit 7c34ed1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pages/home/report/ReactionList/PopoverReactionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import withCurrentUserPersonalDetails from '../../../../components/withCurrentUs
import * as PersonalDetailsUtils from '../../../../libs/PersonalDetailsUtils';
import emojis from '../../../../../assets/emojis';
import * as EmojiUtils from '../../../../libs/EmojiUtils';
import CONST from '../../../../CONST';

const propTypes = {
/** Actions from the ChatReport */
Expand Down Expand Up @@ -68,23 +69,22 @@ class PopoverReactionList extends React.Component {
}

shouldComponentUpdate(nextProps, nextState) {
const prevSelectedReaction = this.getSelectedReaction(this.props.reportActions, this.state.reportActionID, this.state.emojiName);
const selectedReaction = this.getSelectedReaction(nextProps.reportActions, nextState.reportActionID, nextState.emojiName);
const previousLocale = lodashGet(this.props, 'preferredLocale', 'en');
const nextLocale = lodashGet(nextProps, 'preferredLocale', 'en');
const {emojiCount, emojiCodes, hasUserReacted, users} = this.getReactionInformation(selectedReaction);
const previousLocale = lodashGet(this.props, 'preferredLocale', CONST.LOCALES.DEFAULT);
const nextLocale = lodashGet(nextProps, 'preferredLocale', CONST.LOCALES.DEFAULT);

return (
this.state.isPopoverVisible !== nextState.isPopoverVisible ||
this.state.popoverAnchorPosition !== nextState.popoverAnchorPosition ||
previousLocale !== nextLocale ||
(this.state.isPopoverVisible &&
(!_.isEqual(prevSelectedReaction, selectedReaction) ||
(this.state.reportActionID !== nextState.reportActionID ||
this.state.emojiName !== nextState.emojiName ||
this.state.emojiCount !== nextState.emojiCount ||
this.state.hasUserReacted !== nextState.hasUserReacted ||
this.state.reportActionID !== nextState.reportActionID ||
!_.isEqual(this.state.emojiCodes, nextState.emojiCodes) ||
!_.isEqual(this.state.users, nextState.users)))
this.state.emojiCount !== emojiCount ||
this.state.hasUserReacted !== hasUserReacted ||
!_.isEqual(this.state.emojiCodes, emojiCodes) ||
!_.isEqual(this.state.users, users)))
);
}

Expand Down

0 comments on commit 7c34ed1

Please sign in to comment.