Skip to content

Commit

Permalink
Merge pull request #23154 from dukenv0307/fix/23004
Browse files Browse the repository at this point in the history
fix: The green line appear immediately only after comments are added to a task
  • Loading branch information
MonilBhavsar authored Aug 4, 2023
2 parents f9d760f + e3a1e97 commit c3bafa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ const propTypes = {
emojiReactions: EmojiReactionsPropTypes,
personalDetailsList: PropTypes.objectOf(personalDetailsPropType),

/** Is this the only report action on the report? */
isOnlyReportAction: PropTypes.bool,
/** Flag to show, hide the thread divider line */
shouldHideThreadDividerLine: PropTypes.bool,
};

const defaultProps = {
Expand All @@ -114,7 +114,7 @@ const defaultProps = {
personalDetailsList: {},
shouldShowSubscriptAvatar: false,
hasOutstandingIOU: false,
isOnlyReportAction: false,
shouldHideThreadDividerLine: false,
};

function ReportActionItem(props) {
Expand Down Expand Up @@ -454,23 +454,23 @@ function ReportActionItem(props) {
return (
<MoneyRequestView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}
/>
);
}
if (ReportUtils.isTaskReport(props.report)) {
return (
<TaskView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}
/>
);
}
if (ReportUtils.isExpenseReport(props.report) || ReportUtils.isIOUReport(props.report)) {
return (
<MoneyReportView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}
/>
);
}
Expand Down Expand Up @@ -623,6 +623,6 @@ export default compose(
ReportUtils.isCompletedTaskReport(prevProps.report) === ReportUtils.isCompletedTaskReport(nextProps.report) &&
prevProps.report.managerID === nextProps.report.managerID &&
prevProps.report.managerEmail === nextProps.report.managerEmail &&
prevProps.isOnlyReportAction === nextProps.isOnlyReportAction,
prevProps.shouldHideThreadDividerLine === nextProps.shouldHideThreadDividerLine,
),
);
7 changes: 3 additions & 4 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ function ReportActionsList(props) {
reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED &&
ReportUtils.isChatThread(report) &&
!ReportActionsUtils.isTransactionThread(ReportActionsUtils.getParentReportAction(report));
const shouldHideThreadDividerLine =
shouldDisplayParentAction && sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;
const shouldHideThreadDividerLine = sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;
return shouldDisplayParentAction ? (
<ReportActionItemParentAction
shouldHideThreadDividerLine={shouldHideThreadDividerLine}
shouldHideThreadDividerLine={shouldDisplayParentAction && shouldHideThreadDividerLine}
reportID={report.reportID}
parentReportID={`${report.parentReportID}`}
shouldDisplayNewMarker={shouldDisplayNewMarker}
/>
) : (
<ReportActionItem
shouldHideThreadDividerLine={shouldHideThreadDividerLine}
report={report}
action={reportAction}
displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)}
Expand All @@ -148,7 +148,6 @@ function ReportActionsList(props) {
isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID}
hasOutstandingIOU={hasOutstandingIOU}
index={index}
isOnlyReportAction={sortedReportActions.length === 1}
/>
);
},
Expand Down

0 comments on commit c3bafa6

Please sign in to comment.