diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js index 29bdf9ab9d44..585e9b9934b0 100644 --- a/src/libs/actions/Task.js +++ b/src/libs/actions/Task.js @@ -119,6 +119,16 @@ function createTaskAndNavigate(parentReportID, title, description, assignee, ass isOptimisticReport: false, }, }, + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${optimisticTaskReport.reportID}`, + value: {[optimisticTaskCreatedAction.reportActionID]: {pendingAction: null}}, + }, + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`, + value: {[optimisticAddCommentReport.reportAction.reportActionID]: {pendingAction: null}}, + }, ]; const failureData = [ @@ -162,6 +172,12 @@ function createTaskAndNavigate(parentReportID, title, description, assignee, ass }, ); + successData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${assigneeChatReportID}`, + value: {[optimisticAssigneeAddComment.reportAction.reportActionID]: {pendingAction: null}}, + }); + failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${assigneeChatReportID}`,