Skip to content

Commit

Permalink
Merge pull request #48618 from Krishna2323/krishna2323/issue/48089
Browse files Browse the repository at this point in the history
fix: Advanced approval - RHP turns to not here page while dismissing dismissing after deleting the workflow.
  • Loading branch information
srikarparsi authored Sep 16, 2024
2 parents 0c618ac + 931b073 commit 4a9725c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
// eslint-disable-next-line no-restricted-imports
import type {ScrollView} from 'react-native';
import {InteractionManager} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ConfirmModal from '@components/ConfirmModal';
Expand Down Expand Up @@ -58,10 +59,12 @@ function WorkspaceWorkflowsApprovalsEditPage({policy, isLoadingReportData = true
return;
}

// Remove the approval workflow using the initial data as it could be already edited
Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow);
setIsDeleteModalVisible(false);
Navigation.dismissModal();
InteractionManager.runAfterInteractions(() => {
// Remove the approval workflow using the initial data as it could be already edited
Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow);
});
}, [initialApprovalWorkflow, route.params.policyID]);

const {currentApprovalWorkflow, defaultWorkflowMembers, usedApproverEmails} = useMemo(() => {
Expand Down

0 comments on commit 4a9725c

Please sign in to comment.