From 46f8e6b008bdc3143c734ca634feab5fca7331cb Mon Sep 17 00:00:00 2001 From: Filip Sekulic Date: Tue, 14 Feb 2023 11:24:18 +0100 Subject: [PATCH] Fixed metrics --- app/scripts/controllers/metametrics.js | 13 ++++--------- shared/constants/metametrics.js | 1 + 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 84447a95c7fd..6a142da23da0 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -125,8 +125,6 @@ export default class MetaMetricsController { environment === 'production' ? version : `${version}-${environment}`; this.extension = extension; this.environment = environment; - this.transactionSecurityCheckEnabled = - prefState.transactionSecurityCheckEnabled; const abandonedFragments = omitBy(initState?.fragments, 'persist'); const segmentApiCalls = initState?.segmentApiCalls || {}; @@ -145,12 +143,9 @@ export default class MetaMetricsController { }, }); - preferencesStore.subscribe( - ({ currentLocale, transactionSecurityCheckEnabled }) => { - this.locale = currentLocale.replace('_', '-'); - this.transactionSecurityCheckEnabled = transactionSecurityCheckEnabled; - }, - ); + preferencesStore.subscribe(({ currentLocale }) => { + this.locale = currentLocale.replace('_', '-'); + }); onNetworkDidChange(() => { this.chainId = getCurrentChainId(); @@ -721,7 +716,7 @@ export default class MetaMetricsController { [TRAITS.THREE_BOX_ENABLED]: false, // deprecated, hard-coded as false [TRAITS.THEME]: metamaskState.theme || 'default', [TRAITS.TOKEN_DETECTION_ENABLED]: metamaskState.useTokenDetection, - [TRAITS.SECURITY_PROVIDER]: this.transactionSecurityCheckEnabled + [TRAITS.SECURITY_PROVIDER]: metamaskState.transactionSecurityCheckEnabled ? ['opensea'] : [], }; diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index 23447bdfdb73..c6700c7f7bc0 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -240,6 +240,7 @@ export const TRAITS = { * enabled? (deprecated) * @property {string} [theme] - which theme the user has selected * @property {boolean} [token_detection_enabled] - does the user have token detection is enabled? + * @property {Array} [security_provider] - whether security provider feature toggle is on or off */ // Mixpanel converts the zero address value to a truly anonymous event, which