diff --git a/src/libs/actions/Workflow.ts b/src/libs/actions/Workflow.ts index 9731b62838f5..de3824386536 100644 --- a/src/libs/actions/Workflow.ts +++ b/src/libs/actions/Workflow.ts @@ -334,7 +334,7 @@ function clearApprovalWorkflowApprovers() { } function setApprovalWorkflow(approvalWorkflow: NullishDeep) { - Onyx.merge(ONYXKEYS.APPROVAL_WORKFLOW, approvalWorkflow); + Onyx.set(ONYXKEYS.APPROVAL_WORKFLOW, approvalWorkflow); } function clearApprovalWorkflow() { diff --git a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx index 917ef5b8d2ff..ddd33219fbec 100644 --- a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx +++ b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx @@ -146,13 +146,6 @@ function WorkspaceWorkflowsApprovalsExpensesFromPage({policy, isLoadingReportDat } }, [approvalWorkflow, route.params.backTo, route.params.policyID, selectedMembers]); - const goBack = useCallback(() => { - if (isInitialCreationFlow) { - Workflow.clearApprovalWorkflow(); - } - Navigation.goBack(); - }, [isInitialCreationFlow]); - const button = useMemo(() => { let buttonText = isInitialCreationFlow ? translate('common.next') : translate('common.save'); @@ -211,7 +204,7 @@ function WorkspaceWorkflowsApprovalsExpensesFromPage({policy, isLoadingReportDat > Navigation.goBack()} /> {approvalWorkflow?.action === CONST.APPROVAL_WORKFLOW.ACTION.CREATE && !shouldShowListEmptyContent && (