diff --git a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx index 21c92f809d22..c2da4e39739a 100644 --- a/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx +++ b/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx @@ -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'; @@ -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(() => {