Skip to content

Commit

Permalink
Merge pull request #52163 from daledah/fix/51282
Browse files Browse the repository at this point in the history
fix: Not found page appear briefly after updating the first approver
  • Loading branch information
deetergp authored Nov 15, 2024
2 parents 992e5d4 + c5f4672 commit 044936e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useFocusEffect} from '@react-navigation/native';
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useMemo, useState} from 'react';
import {ActivityIndicator, View} from 'react-native';
import {ActivityIndicator, InteractionManager, View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import ApprovalWorkflowSection from '@components/ApprovalWorkflowSection';
import ConfirmModal from '@components/ConfirmModal';
Expand Down Expand Up @@ -92,7 +92,9 @@ function WorkspaceWorkflowsPage({policy, route}: WorkspaceWorkflowsPageProps) {

useFocusEffect(
useCallback(() => {
fetchData();
InteractionManager.runAfterInteractions(() => {
fetchData();
});
}, [fetchData]),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ function WorkspaceWorkflowsApprovalsEditPage({policy, isLoadingReportData = true
// We need to remove members and approvers that are no longer in the updated workflow
const membersToRemove = initialApprovalWorkflow.members.filter((initialMember) => !approvalWorkflow.members.some((member) => member.email === initialMember.email));
const approversToRemove = initialApprovalWorkflow.approvers.filter((initialApprover) => !approvalWorkflow.approvers.some((approver) => approver.email === initialApprover.email));
Workflow.updateApprovalWorkflow(route.params.policyID, approvalWorkflow, membersToRemove, approversToRemove);
Navigation.dismissModal();
InteractionManager.runAfterInteractions(() => {
Workflow.updateApprovalWorkflow(route.params.policyID, approvalWorkflow, membersToRemove, approversToRemove);
});
}, [approvalWorkflow, initialApprovalWorkflow, route.params.policyID]);

const removeApprovalWorkflow = useCallback(() => {
Expand Down

0 comments on commit 044936e

Please sign in to comment.