diff --git a/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts b/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts index 2a1b63132f3..8d3ff6f05b6 100644 --- a/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts +++ b/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts @@ -1,10 +1,13 @@ import { useMemo } from 'react'; +import { useSelector } from 'react-redux'; import { ApprovalTypes } from '../../../../core/RPCMethods/RPCMethodMiddleware'; +import { selectRemoteFeatureFlags } from '../../../../selectors/featureFlagController'; import useApprovalRequest from './useApprovalRequest'; const useConfirmationRedesignEnabled = () => { const { approvalRequest } = useApprovalRequest(); + const { confirmation_redesign } = useSelector(selectRemoteFeatureFlags); const { type: approvalRequestType } = approvalRequest ?? { requestData: {}, @@ -12,12 +15,13 @@ const useConfirmationRedesignEnabled = () => { const isRedesignedEnabled = useMemo( () => - approvalRequestType && + (confirmation_redesign as Record)?.signatures && process.env.REDESIGNED_SIGNATURE_REQUEST === 'true' && + approvalRequestType && [ApprovalTypes.PERSONAL_SIGN, ApprovalTypes.ETH_SIGN_TYPED_DATA].includes( approvalRequestType as ApprovalTypes, ), - [approvalRequestType], + [approvalRequestType, confirmation_redesign], ); return { isRedesignedEnabled }; diff --git a/app/util/test/confirm-data-helpers.ts b/app/util/test/confirm-data-helpers.ts index ec6d4f1f319..408f70b8788 100644 --- a/app/util/test/confirm-data-helpers.ts +++ b/app/util/test/confirm-data-helpers.ts @@ -32,6 +32,13 @@ export const personalSignatureConfirmationState = { pendingApprovalCount: 1, approvalFlows: [], }, + RemoteFeatureFlagController: { + remoteFeatureFlags: { + confirmation_redesign: { + signatures: true, + }, + }, + }, }, }, }; @@ -95,6 +102,13 @@ export const typedSignV1ConfirmationState = { }, }, }, + RemoteFeatureFlagController: { + remoteFeatureFlags: { + confirmation_redesign: { + signatures: true, + }, + }, + }, }, }, }; @@ -184,6 +198,13 @@ export const typedSignV3ConfirmationState = { }, }, }, + RemoteFeatureFlagController: { + remoteFeatureFlags: { + confirmation_redesign: { + signatures: true, + }, + }, + }, }, }, };