Skip to content

Commit

Permalink
fix approval flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Nodebrute committed Oct 8, 2024
1 parent 36115be commit 12963d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/Workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function clearApprovalWorkflowApprovers() {
}

function setApprovalWorkflow(approvalWorkflow: NullishDeep<ApprovalWorkflowOnyx>) {
Onyx.merge(ONYXKEYS.APPROVAL_WORKFLOW, approvalWorkflow);
Onyx.set(ONYXKEYS.APPROVAL_WORKFLOW, approvalWorkflow);
}

function clearApprovalWorkflow() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -211,7 +204,7 @@ function WorkspaceWorkflowsApprovalsExpensesFromPage({policy, isLoadingReportDat
>
<HeaderWithBackButton
title={translate('workflowsExpensesFromPage.title')}
onBackButtonPress={goBack}
onBackButtonPress={() => Navigation.goBack()}
/>

{approvalWorkflow?.action === CONST.APPROVAL_WORKFLOW.ACTION.CREATE && !shouldShowListEmptyContent && (
Expand Down

0 comments on commit 12963d8

Please sign in to comment.