Skip to content

Commit

Permalink
Uses lodash get to guard against undefined
Browse files Browse the repository at this point in the history
Adds lodashGet
  • Loading branch information
abdel-h66 committed Oct 3, 2023
1 parent 3ba9ba0 commit b0145f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Reactions/ReportActionItemEmojiReactions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useRef, useContext} from 'react';
import lodashGet from 'lodash/get';
import _ from 'underscore';
import {View} from 'react-native';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -113,7 +114,7 @@ function ReportActionItemEmojiReactions(props) {
reactionCount,
hasUserReacted,
onReactionListOpen,
hasPendingAction: reaction.pendingAction,
pendingAction: reaction.pendingAction,
};
});

Expand All @@ -139,8 +140,8 @@ function ReportActionItemEmojiReactions(props) {
>
<View>
<OfflineWithFeedback
pendingAction={reaction.hasPendingAction}
shouldDisableOpacity={Boolean(reportAction.pendingAction)}
pendingAction={reaction.pendingAction}
shouldDisableOpacity={Boolean(lodashGet(reportAction, 'pendingAction'))}
>
<EmojiReactionBubble
ref={(ref) => (popoverReactionListAnchors.current[reaction.reactionEmojiName] = ref)}
Expand Down

0 comments on commit b0145f1

Please sign in to comment.