Skip to content

Commit

Permalink
Fix E2E and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwalsh0 committed Dec 4, 2024
1 parent 39f0c5b commit 71bea94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ui/pages/confirmations/hooks/syncConfirmPath.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useEffect } from 'react';
import { useParams } from 'react-router-dom';

import { ApprovalType, ORIGIN_METAMASK } from '@metamask/controller-utils';
import { ApprovalRequest } from '@metamask/approval-controller';
import { Json } from '@metamask/utils';
import { Confirmation } from '../types/confirm';
import { useConfirmationNavigation } from './useConfirmationNavigation';

Expand All @@ -14,6 +17,19 @@ const syncConfirmPath = (currentConfirmation?: Confirmation) => {
return;
}

const approvalRequest = currentConfirmation as ApprovalRequest<
Record<string, Json>
>;

// Do not redirect if the current confirmation is a wallet triggered add network approval.
// Handled by NetworkConfirmationPopover component in routes.
if (
approvalRequest.type === ApprovalType.AddEthereumChain &&
approvalRequest.origin === ORIGIN_METAMASK
) {
return;
}

if (!paramId) {
navigateToId(confirmationId);
}
Expand Down

0 comments on commit 71bea94

Please sign in to comment.