Skip to content

Commit

Permalink
Clear the pending actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Jun 12, 2024
1 parent 8ef24ae commit 9e3f74a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3301,6 +3301,13 @@ function completeOnboarding(

const tasksForSuccessData = tasksData.reduce<OnyxUpdate[]>((acc, {currentTask, taskCreatedAction, completedTaskReportAction}) => {
acc.push(
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
value: {
[taskReportAction.reportAction.reportActionID]: {pendingAction: null},
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${currentTask.reportID}`,
Expand All @@ -3318,7 +3325,7 @@ function completeOnboarding(
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${currentTask.reportID}`,
value: {
[taskCreatedAction.reportActionID]: taskCreatedAction as ReportAction,
[taskCreatedAction.reportActionID]: {pendingAction: null},
},
},
);
Expand All @@ -3328,16 +3335,7 @@ function completeOnboarding(
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${currentTask.reportID}`,
value: {
[completedTaskReportAction.reportActionID]: completedTaskReportAction as ReportAction,
},
});

acc.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${currentTask.reportID}`,
value: {
stateNum: CONST.REPORT.STATE_NUM.APPROVED,
statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
[completedTaskReportAction.reportActionID]: {pendingAction: null},
},
});
}
Expand Down

0 comments on commit 9e3f74a

Please sign in to comment.