diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js index 8e9a76f4096a..e7b29bb7ea6c 100644 --- a/src/libs/actions/Task.js +++ b/src/libs/actions/Task.js @@ -774,8 +774,8 @@ function cancelTask(taskReportID, taskTitle, originalStateNum, originalStatusNum onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${parentReport.reportID}`, value: { - lastMessageText: ReportActionsUtils.getLastVisibleMessage(parentReport.reportID, {[parentReportAction.reportActionID]: null}).lastMessageText, - lastVisibleActionCreated: ReportActionsUtils.getLastVisibleAction(parentReport.reportID, {[parentReportAction.reportActionID]: null}).created, + lastMessageText: ReportActionsUtils.getLastVisibleMessage(parentReport.reportID, optimisticReportActions).lastMessageText, + lastVisibleActionCreated: ReportActionsUtils.getLastVisibleAction(parentReport.reportID, optimisticReportActions).created, }, }, {