From 91d5d4edfcb4ccc8978ca98bbba4c3635999b0d7 Mon Sep 17 00:00:00 2001 From: Bowen Sanders Date: Mon, 15 Apr 2024 02:45:07 -0700 Subject: [PATCH 01/24] test: [Snaps E2E] add more snaps localization testing (#23796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR adds checks for snap name localization to the snaps localization E2E test. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/23796?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1653 ## **Manual testing steps** 1. Run this as a single test locally. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- test/e2e/snaps/test-snap-get-locale.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/e2e/snaps/test-snap-get-locale.spec.js b/test/e2e/snaps/test-snap-get-locale.spec.js index aeff38abd975..575aefafd8b7 100644 --- a/test/e2e/snaps/test-snap-get-locale.spec.js +++ b/test/e2e/snaps/test-snap-get-locale.spec.js @@ -47,6 +47,12 @@ describe('Test Snap Get Locale', function () { tag: 'button', }); + // look for the snap name + await driver.waitForSelector({ + text: 'Localization Example Snap', + tag: 'p', + }); + await driver.waitForSelector({ text: 'Install' }); await driver.clickElementSafe('[data-testid="snap-install-scroll"]'); @@ -115,6 +121,20 @@ describe('Test Snap Get Locale', function () { // try to select dansk from the list await driver.clickElement({ text: 'Dansk', tag: 'option' }); + // click on the global action menu + await driver.waitForSelector( + '[data-testid="account-options-menu-button"]', + ); + await driver.clickElement( + '[data-testid="account-options-menu-button"]', + ); + + // try to click on snaps + await driver.clickElement({ text: 'Snaps', tag: 'div' }); + + // check for localized snap title + await driver.waitForSelector({ text: 'Oversættelses Eksempel Snap' }); + // switch back to test snaps tab windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); From 96d478a5d6ef7842d89ba9b72b8d319565fe28d1 Mon Sep 17 00:00:00 2001 From: Hassan Malik <41640681+hmalik88@users.noreply.github.com> Date: Mon, 15 Apr 2024 07:26:39 -0400 Subject: [PATCH 02/24] feat: Release Transaction Insights V2 & Signature Insights to stable (#23630) --- shared/constants/permissions.test.js | 1 - shared/constants/snaps/permissions.ts | 4 +- test/e2e/run-all.js | 6 +- test/e2e/snaps/test-snap-siginsights.spec.js | 10 ---- .../app/snaps/snap-insight/snap-insight.js | 57 +++---------------- ui/helpers/constants/snaps/delineator.ts | 4 -- ui/helpers/utils/permission.js | 3 +- ui/hooks/snaps/useTransactionInsightSnaps.js | 46 +++++++-------- ui/hooks/useTransactionInsights.js | 48 +--------------- .../confirm-page-container.component.js | 8 +-- .../signature-request-original.component.js | 16 +++--- .../signature-request-siwe.js | 14 ++--- .../signature-request/signature-request.js | 12 ++-- .../confirm-signature-request/index.js | 6 +- 14 files changed, 62 insertions(+), 173 deletions(-) diff --git a/shared/constants/permissions.test.js b/shared/constants/permissions.test.js index 38dc1e1c87a4..b63014359bb7 100644 --- a/shared/constants/permissions.test.js +++ b/shared/constants/permissions.test.js @@ -15,7 +15,6 @@ describe('EndowmentPermissions', () => { expect(Object.keys(EndowmentPermissions).sort()).toStrictEqual( [ 'endowment:name-lookup', - 'endowment:signature-insight', ...Object.keys(endowmentPermissionBuilders).filter( (targetName) => !Object.keys(ExcludedSnapEndowments).includes(targetName), diff --git a/shared/constants/snaps/permissions.ts b/shared/constants/snaps/permissions.ts index f0c798e05e0b..aca6f5ef8023 100644 --- a/shared/constants/snaps/permissions.ts +++ b/shared/constants/snaps/permissions.ts @@ -7,8 +7,8 @@ export const EndowmentPermissions = Object.freeze({ 'endowment:webassembly': 'endowment:webassembly', 'endowment:lifecycle-hooks': 'endowment:lifecycle-hooks', 'endowment:page-home': 'endowment:page-home', - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) 'endowment:signature-insight': 'endowment:signature-insight', + ///: BEGIN:ONLY_INCLUDE_IF(build-flask) 'endowment:name-lookup': 'endowment:name-lookup', ///: END:ONLY_INCLUDE_IF ///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps) @@ -26,8 +26,6 @@ export const ExcludedSnapEndowments = Object.freeze({ ///: BEGIN:ONLY_INCLUDE_IF(build-main) 'endowment:name-lookup': 'This endowment is experimental and therefore not available.', - 'endowment:signature-insight': - 'This endowment is experimental and therefore not available.', ///: END:ONLY_INCLUDE_IF }); diff --git a/test/e2e/run-all.js b/test/e2e/run-all.js index 6bf0fec21272..0ff043261a7b 100644 --- a/test/e2e/run-all.js +++ b/test/e2e/run-all.js @@ -8,11 +8,7 @@ const { exitWithError } = require('../../development/lib/exit-with-error'); const { loadBuildTypesConfig } = require('../../development/lib/build-type'); // These tests should only be run on Flask for now. -const FLASK_ONLY_TESTS = [ - 'test-snap-txinsights-v2.spec.js', - 'test-snap-namelookup.spec.js', - 'test-snap-siginsights.spec.js', -]; +const FLASK_ONLY_TESTS = ['test-snap-namelookup.spec.js']; const getTestPathsForTestDir = async (testDir) => { const testFilenames = await fs.promises.readdir(testDir, { diff --git a/test/e2e/snaps/test-snap-siginsights.spec.js b/test/e2e/snaps/test-snap-siginsights.spec.js index cb04d15e0ba2..d9448856b0de 100644 --- a/test/e2e/snaps/test-snap-siginsights.spec.js +++ b/test/e2e/snaps/test-snap-siginsights.spec.js @@ -77,16 +77,6 @@ describe('Test Snap Signature Insights', function () { windowHandles, ); - // wait for and click use flask - await driver.waitForSelector({ - text: 'Use MetaMask Flask', - tag: 'button', - }); - await driver.clickElement({ - text: 'Use MetaMask Flask', - tag: 'button', - }); - // find and scroll to basic actions and click connect const connectButton1 = await driver.findElement('#connectButton'); await driver.scrollToElement(connectButton1); diff --git a/ui/components/app/snaps/snap-insight/snap-insight.js b/ui/components/app/snaps/snap-insight/snap-insight.js index 2f65756d648f..c13f3206f62e 100644 --- a/ui/components/app/snaps/snap-insight/snap-insight.js +++ b/ui/components/app/snaps/snap-insight/snap-insight.js @@ -19,35 +19,15 @@ import { SnapDelineator } from '../snap-delineator'; import { DelineatorType } from '../../../../helpers/constants/snaps'; import { Copyable } from '../copyable'; import { getSnapMetadata } from '../../../../selectors'; -import { - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) - deleteInterface, - ///: END:ONLY_INCLUDE_IF - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - trackInsightSnapUsage, - ///: END:ONLY_INCLUDE_IF -} from '../../../../store/actions'; -///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) -import { useTransactionInsightSnaps } from '../../../../hooks/snaps/useTransactionInsightSnaps'; -///: END:ONLY_INCLUDE_IF +import { trackInsightSnapUsage } from '../../../../store/actions'; -export const SnapInsight = ({ - snapId, - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - data, - ///: END:ONLY_INCLUDE_IF - loading, - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) - insightHookParams, - ///: END:ONLY_INCLUDE_IF -}) => { +export const SnapInsight = ({ snapId, data, loading }) => { const dispatch = useDispatch(); const t = useI18nContext(); - let error, interfaceId; - let isLoading = loading; - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - error = data?.error; - interfaceId = data?.response?.id; + const isLoading = loading; + const error = data?.error; + const interfaceId = data?.response?.id; + useEffect(() => { const trackInsightUsage = async () => { try { @@ -58,20 +38,6 @@ export const SnapInsight = ({ }; trackInsightUsage(); }, [snapId, dispatch]); - ///: END:ONLY_INCLUDE_IF - - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) - const insights = useTransactionInsightSnaps(insightHookParams); - error = insights.data?.[0]?.error; - interfaceId = insights.data?.[0]?.response?.id; - isLoading = insights.loading; - - useEffect(() => { - return () => { - interfaceId && dispatch(deleteInterface(interfaceId)); - }; - }, [interfaceId]); - ///: END:ONLY_INCLUDE_IF const { name: snapName } = useSelector((state) => getSnapMetadata(state, snapId), @@ -131,21 +97,16 @@ export const SnapInsight = ({ }; SnapInsight.propTypes = { + /** + * The snap id + */ snapId: PropTypes.string, - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) /* * The insight object */ data: PropTypes.object, - ///: END:ONLY_INCLUDE_IF /* * Boolean as to whether or not the insights are loading */ loading: PropTypes.bool, - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) - /** - * Params object for the useTransactionInsightSnaps hook - */ - insightHookParams: PropTypes.object, - ///: END:ONLY_INCLUDE_IF }; diff --git a/ui/helpers/constants/snaps/delineator.ts b/ui/helpers/constants/snaps/delineator.ts index f3ab5b3f164a..7ee388d25c11 100644 --- a/ui/helpers/constants/snaps/delineator.ts +++ b/ui/helpers/constants/snaps/delineator.ts @@ -4,9 +4,7 @@ export enum DelineatorType { Error = 'error', Insights = 'insights', Description = 'description', - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) Warning = 'warning', - ///: END:ONLY_INCLUDE_IF } export const getDelineatorTitle = (type: DelineatorType) => { @@ -17,10 +15,8 @@ export const getDelineatorTitle = (type: DelineatorType) => { return 'insightsFromSnap'; case DelineatorType.Description: return 'descriptionFromSnap'; - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) case DelineatorType.Warning: return 'warningFromSnap'; - ///: END:ONLY_INCLUDE_IF default: return 'contentFromSnap'; } diff --git a/ui/helpers/utils/permission.js b/ui/helpers/utils/permission.js index 2ab0ec076f27..8197059de434 100644 --- a/ui/helpers/utils/permission.js +++ b/ui/helpers/utils/permission.js @@ -522,6 +522,7 @@ export const PERMISSION_DESCRIPTIONS = deepFreeze({ leftIcon: getLeftIcon(IconName.Search), weight: 4, }), + ///: END:ONLY_INCLUDE_IF [EndowmentPermissions['endowment:signature-insight']]: ({ t, permissionValue, @@ -560,7 +561,7 @@ export const PERMISSION_DESCRIPTIONS = deepFreeze({ return result; }, - ///: END:ONLY_INCLUDE_IF + [UNKNOWN_PERMISSION]: ({ t, permissionName }) => ({ label: t('permission_unknown', [permissionName ?? 'undefined']), leftIcon: getLeftIcon(IconName.Question), diff --git a/ui/hooks/snaps/useTransactionInsightSnaps.js b/ui/hooks/snaps/useTransactionInsightSnaps.js index 9b4414837287..6e78a5f2b9e5 100644 --- a/ui/hooks/snaps/useTransactionInsightSnaps.js +++ b/ui/hooks/snaps/useTransactionInsightSnaps.js @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { getTransactionOriginCaveat } from '@metamask/snaps-rpc-methods'; +import { SeverityLevel } from '@metamask/snaps-sdk'; import { handleSnapRequest } from '../../store/actions'; import { getPermissionSubjectsDeepEqual } from '../../selectors'; @@ -11,38 +12,26 @@ export function useTransactionInsightSnaps({ chainId, origin, insightSnaps, - eagerFetching = true, - insightSnapId = '', }) { const subjects = useSelector(getPermissionSubjectsDeepEqual); const [loading, setLoading] = useState(true); const [data, setData] = useState(undefined); - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - const [hasFetchedV2Insight, setHasFetchedV2Insight] = useState(false); - ///: END:ONLY_INCLUDE_IF + const [hasFetchedInsight, setHasFetchedInsight] = useState(false); + useEffect(() => { let cancelled = false; async function fetchInsight() { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - if (hasFetchedV2Insight) { - setLoading(false); - return; - } - ///: END:ONLY_INCLUDE_IF - - if (!eagerFetching) { + if (hasFetchedInsight) { setLoading(false); return; } setLoading(true); - const snapIds = insightSnapId.length > 0 ? [insightSnapId] : insightSnaps; - const newData = await Promise.allSettled( - snapIds.map((snapId) => { + insightSnaps.map((snapId) => { const permission = subjects[snapId]?.permissions[INSIGHT_PERMISSION]; if (!permission) { return Promise.reject( @@ -69,7 +58,7 @@ export function useTransactionInsightSnaps({ ); const reformattedData = newData.map((promise, idx) => { - const snapId = snapIds[idx]; + const snapId = insightSnaps[idx]; if (promise.status === 'rejected') { return { error: promise.reason, @@ -85,9 +74,7 @@ export function useTransactionInsightSnaps({ if (!cancelled) { setData(reformattedData); setLoading(false); - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - setHasFetchedV2Insight(true); - ///: END:ONLY_INCLUDE_IF + setHasFetchedInsight(true); } } if (transaction && Object.keys(transaction).length > 0) { @@ -98,17 +85,24 @@ export function useTransactionInsightSnaps({ }; }, [ transaction, - eagerFetching, chainId, origin, subjects, // TODO: Figure out how to improve this JSON.stringify(insightSnaps), - insightSnapId, - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - hasFetchedV2Insight, - ///: END:ONLY_INCLUDE_IF + hasFetchedInsight, ]); - return { data, loading }; + const warnings = data?.reduce((warningsArr, promise) => { + if (promise.response?.severity === SeverityLevel.Critical) { + const { + snapId, + response: { id }, + } = promise; + warningsArr.push({ snapId, id }); + } + return warningsArr; + }, []); + + return { data, loading, warnings }; } diff --git a/ui/hooks/useTransactionInsights.js b/ui/hooks/useTransactionInsights.js index 77653a6d15af..b6d1a851aec1 100644 --- a/ui/hooks/useTransactionInsights.js +++ b/ui/hooks/useTransactionInsights.js @@ -1,12 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) - useDispatch, - ///: END:ONLY_INCLUDE_IF - useSelector, -} from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; -import { SeverityLevel } from '@metamask/snaps-sdk'; import { TransactionType } from '@metamask/transaction-controller'; import { stripHexPrefix } from '../../shared/modules/hexstring-utils'; import { Tab } from '../components/ui/tabs'; @@ -17,9 +11,7 @@ import { getInsightSnaps, getSnapsMetadata, } from '../selectors'; -///: BEGIN:ONLY_INCLUDE_IF(build-flask) import { deleteInterface } from '../store/actions'; -///: END:ONLY_INCLUDE_IF import { getSnapName } from '../helpers/utils/util'; import { useTransactionInsightSnaps } from './snaps/useTransactionInsightSnaps'; @@ -34,9 +26,7 @@ const isAllowedTransactionTypes = (transactionType) => // https://github.com/MetaMask/metamask-extension/blob/develop/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js#L129 // Thus it is not possible to use React Component here const useTransactionInsights = ({ txData }) => { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) const dispatch = useDispatch(); - ///: END:ONLY_INCLUDE_IF const { txParams, chainId, origin } = txData; const caip2ChainId = `eip155:${stripHexPrefix(chainId)}`; const insightSnaps = useSelector(getInsightSnaps); @@ -54,17 +44,10 @@ const useTransactionInsights = ({ txData }) => { chainId: caip2ChainId, origin, insightSnaps: insightSnapIds, - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) - insightSnapId: selectedInsightSnapId, - ///: END:ONLY_INCLUDE_IF }; - const { data, loading } = useTransactionInsightSnaps({ - ...insightHookParams, - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-mmi,build-beta) - eagerFetching: false, - ///: END:ONLY_INCLUDE_IF - }); + const { data, loading, warnings } = + useTransactionInsightSnaps(insightHookParams); useEffect(() => { if (insightSnapIds.length > 0 && !selectedInsightSnapId) { @@ -72,7 +55,6 @@ const useTransactionInsights = ({ txData }) => { } }, [insightSnapIds, selectedInsightSnapId, setSelectedInsightSnapId]); - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) useEffect(() => { return () => { data?.map( @@ -81,7 +63,6 @@ const useTransactionInsights = ({ txData }) => { ); }; }, [data]); - ///: END:ONLY_INCLUDE_IF if (!isAllowedTransactionTypes(txData.type) || !insightSnaps.length) { return null; @@ -103,13 +84,8 @@ const useTransactionInsights = ({ txData }) => { > ); @@ -122,11 +98,9 @@ const useTransactionInsights = ({ txData }) => { }; }); - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) const selectedSnapData = data?.find( (promise) => promise?.snapId === selectedInsightSnapId, ); - ///: END:ONLY_INCLUDE_IF insightComponent = ( { ); } - const warnings = data?.reduce((warningsArr, promise) => { - if (promise.response?.severity === SeverityLevel.Critical) { - const { - snapId, - response: { id }, - } = promise; - warningsArr.push({ snapId, id }); - } - return warningsArr; - }, []); - return { insightComponent, warnings }; }; diff --git a/ui/pages/confirmations/components/confirm-page-container/confirm-page-container.component.js b/ui/pages/confirmations/components/confirm-page-container/confirm-page-container.component.js index 841a12d0e232..82fd617131b7 100644 --- a/ui/pages/confirmations/components/confirm-page-container/confirm-page-container.component.js +++ b/ui/pages/confirmations/components/confirm-page-container/confirm-page-container.component.js @@ -39,8 +39,6 @@ import SetApproveForAllWarning from '../set-approval-for-all-warning'; import { useI18nContext } from '../../../../hooks/useI18nContext'; ///: BEGIN:ONLY_INCLUDE_IF(snaps) import useTransactionInsights from '../../../../hooks/useTransactionInsights'; -///: END:ONLY_INCLUDE_IF -///: BEGIN:ONLY_INCLUDE_IF(build-flask) import InsightWarnings from '../../../../components/app/snaps/insight-warnings'; ///: END:ONLY_INCLUDE_IF import { @@ -120,7 +118,7 @@ const ConfirmPageContainer = (props) => { const trackEvent = useContext(MetaMetricsContext); ///: END:ONLY_INCLUDE_IF const [collectionBalance, setCollectionBalance] = useState('0'); - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) const [isShowingTxInsightWarnings, setIsShowingTxInsightWarnings] = useState(false); ///: END:ONLY_INCLUDE_IF @@ -177,7 +175,7 @@ const ConfirmPageContainer = (props) => { // TODO: Better name const topLevelHandleSubmit = () => { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) if (insightObject?.warnings?.length > 0) { return setIsShowingTxInsightWarnings(true); } @@ -380,7 +378,7 @@ const ConfirmPageContainer = (props) => { )} { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) } {isShowingTxInsightWarnings && ( = 1) { return this.setState({ showSignatureInsights: true }); } @@ -420,7 +418,7 @@ export default class SignatureRequestOriginal extends Component { messagesCount, fromAccount: { address, name }, txData, - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) warnings, ///: END:ONLY_INCLUDE_IF } = this.props; @@ -448,7 +446,7 @@ export default class SignatureRequestOriginal extends Component { senderAddress={address} name={name} onSubmit={async () => { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) if (warnings?.length >= 1) { return this.setState({ showSignatureInsights: true, @@ -462,7 +460,7 @@ export default class SignatureRequestOriginal extends Component { /> )} { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) } {this.state.showSignatureInsights && ( { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) if (warnings?.length >= 1) { return isSIWEDomainValid ? setIsShowingSigInsightWarnings(true) @@ -251,7 +251,7 @@ export default function SignatureRequestSIWE({ cancelText={t('cancel')} cancelButtonType="default" onSubmit={() => { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) if (warnings?.length >= 1) { return setIsShowingSigInsightWarnings(true); } @@ -285,7 +285,7 @@ export default function SignatureRequestSIWE({ )} { - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) } {isShowingSigInsightWarnings && ( { @@ -138,7 +138,7 @@ const SignatureRequest = ({ const { custodySignFn } = useMMICustodySignMessage(); ///: END:ONLY_INCLUDE_IF - ///: BEGIN:ONLY_INCLUDE_IF(build-flask) + ///: BEGIN:ONLY_INCLUDE_IF(snaps) const [isShowingSigInsightWarnings, setIsShowingSigInsightWarnings] = useState(false); ///: END:ONLY_INCLUDE_IF @@ -373,7 +373,7 @@ const SignatureRequest = ({