Skip to content

Commit

Permalink
Merge pull request #19106 from Expensify/georgia-zeroThreadReplies
Browse files Browse the repository at this point in the history
Fix 0 Replies Bug FE
  • Loading branch information
neil-marcellini authored May 17, 2023
2 parents 1fcd04e + 8acd7fa commit 088fbfe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,14 @@ class ReportActionItem extends Component {

const reactions = _.get(this.props, ['action', 'message', 0, 'reactions'], []);
const hasReactions = reactions.length > 0;
const numberOfThreadReplies = _.get(this.props, ['action', 'childVisibleActionCount'], 0);
const hasReplies = numberOfThreadReplies > 0;

const shouldDisplayThreadReplies =
this.props.action.childCommenterCount && Permissions.canUseThreads(this.props.betas) && !ReportUtils.isThreadFirstChat(this.props.action, this.props.report.reportID);
hasReplies &&
this.props.action.childCommenterCount &&
Permissions.canUseThreads(this.props.betas) &&
!ReportUtils.isThreadFirstChat(this.props.action, this.props.report.reportID);
const oldestFourEmails = lodashGet(this.props.action, 'childOldestFourEmails', '').split(',');

return (
Expand All @@ -301,7 +307,7 @@ class ReportActionItem extends Component {
{shouldDisplayThreadReplies && (
<ReportActionItemThread
childReportID={`${this.props.action.childReportID}`}
numberOfReplies={this.props.action.childVisibleActionCount || 0}
numberOfReplies={numberOfThreadReplies}
mostRecentReply={`${this.props.action.childLastVisibleActionCreated}`}
isHovered={hovered}
icons={ReportUtils.getIconsForParticipants(oldestFourEmails, this.props.personalDetails)}
Expand Down

0 comments on commit 088fbfe

Please sign in to comment.