Skip to content

Commit

Permalink
Merge pull request #50437 from Nodebrute/approval
Browse files Browse the repository at this point in the history
fix approval flow
  • Loading branch information
stitesExpensify authored Oct 9, 2024
2 parents bfdd19b + 12963d8 commit 0ce5241
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 0ce5241

Please sign in to comment.