Skip to content

Commit

Permalink
feat: update how we check for transaction confirmations
Browse files Browse the repository at this point in the history
  • Loading branch information
httpJunkie committed Dec 18, 2024
1 parent ba8f557 commit 80f264a
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useCallback } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { TransactionType } from '@metamask/transaction-controller';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import {
BannerAlert,
Expand All @@ -12,6 +13,7 @@ import { AlertTypes } from '../../../../../shared/constants/alerts';
import { SMART_TRANSACTIONS_LEARN_MORE_URL } from '../../../../../shared/constants/smartTransactions';
import { FontWeight } from '../../../../helpers/constants/design-system';
import { useConfirmContext } from '../../context/confirm';
import { isCorrectDeveloperTransactionType } from '../../../../../shared/lib/confirmation.utils';

type MarginType = 'default' | 'none' | 'noTop' | 'onlyTop';

Expand Down Expand Up @@ -95,13 +97,9 @@ export const SmartTransactionsBannerAlert: React.FC<SmartTransactionsBannerAlert
: alertEnabled &&
smartTransactionsOptIn &&
smartTransactionsMigrationApplied &&
[
'simpleSend',
'tokenMethodTransfer',
'swap',
'contractDeployment',
'contractInteraction',
].includes(currentConfirmation?.type as string);
isCorrectDeveloperTransactionType(
currentConfirmation?.type as TransactionType,
);

if (!shouldRender) {
return null;
Expand Down

0 comments on commit 80f264a

Please sign in to comment.