Skip to content

Commit

Permalink
Merge pull request #35252 from kubabutkiewicz/fix-regression-after-ta…
Browse files Browse the repository at this point in the history
…sk-migration

fix: After deleting task report is bolded in LHN and action is highlighted in report
  • Loading branch information
marcochavezf authored Feb 1, 2024
2 parents ba6c19a + 8483009 commit c675857
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@ function deleteTask(taskReportID: string, taskTitle: string, originalStateNum: n
],
errors: undefined,
linkMetadata: [],
reportActionID: '',
};
const optimisticReportActions = {
[parentReportAction.reportActionID]: optimisticReportAction,
Expand All @@ -751,8 +750,7 @@ function deleteTask(taskReportID: string, taskTitle: string, originalStateNum: n
key: `${ONYXKEYS.COLLECTION.REPORT}${parentReport?.reportID}`,
value: {
lastMessageText: ReportActionsUtils.getLastVisibleMessage(parentReport?.reportID ?? '', optimisticReportActions as OnyxTypes.ReportActions).lastMessageText ?? '',
lastVisibleActionCreated:
ReportActionsUtils.getLastVisibleAction(parentReport?.reportID ?? '', optimisticReportActions as OnyxTypes.ReportActions)?.childLastVisibleActionCreated ?? 'created',
lastVisibleActionCreated: ReportActionsUtils.getLastVisibleAction(parentReport?.reportID ?? '', optimisticReportActions as OnyxTypes.ReportActions)?.created,
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function ReportActionItem(props) {
const prevDraftMessage = usePrevious(props.draftMessage);
const originalReportID = ReportUtils.getOriginalReportID(props.report.reportID, props.action);
const originalReport = props.report.reportID === originalReportID ? props.report : ReportUtils.getReport(originalReportID);
const isReportActionLinked = props.linkedReportActionID === props.action.reportActionID;
const isReportActionLinked = props.linkedReportActionID && props.action.reportActionID && props.linkedReportActionID === props.action.reportActionID;

const highlightedBackgroundColorIfNeeded = useMemo(
() => (isReportActionLinked ? StyleUtils.getBackgroundColorStyle(theme.hoverComponentBG) : {}),
Expand Down

0 comments on commit c675857

Please sign in to comment.