Skip to content

Commit

Permalink
fix: metrics event not fired when blockaid is disabled (#8088)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuri authored Dec 18, 2023
1 parent 1b4339c commit c4b18ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const BlockaidIndicator = ({ navigation }: Props) => {
AnalyticsV2.trackEvent(
MetaMetricsEvents.SETTINGS_EXPERIMENTAL_SECURITY_ALERTS_ENABLED,
{
security_alerts_enabled: !securityAlertsEnabled,
security_alerts_enabled: true,
},
);
});
Expand Down
8 changes: 8 additions & 0 deletions app/components/Views/Settings/ExperimentalSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import Text, {
TextVariant,
TextColor,
} from '../../../../component-library/components/Texts/Text';
import AnalyticsV2 from '../../../../util/analyticsV2';
import { MetaMetricsEvents } from '../../../../core/Analytics';
import { getNavigationOptionsTitle } from '../../../UI/Navbar';
import StyledButton from '../../../UI/StyledButton';
import SECURITY_ALERTS_TOGGLE_TEST_ID from './constants';
Expand Down Expand Up @@ -39,6 +41,12 @@ const ExperimentalSettings = ({ navigation, route }: Props) => {
ppomInitializationCompleted: false,
});
PreferencesController?.setSecurityAlertsEnabled(!securityAlertsEnabled);
AnalyticsV2.trackEvent(
MetaMetricsEvents.SETTINGS_EXPERIMENTAL_SECURITY_ALERTS_ENABLED,
{
security_alerts_enabled: false,
},
);
} else {
navigation.navigate(Routes.MODAL.ROOT_MODAL_FLOW, {
screen: Routes.SHEET.BLOCKAID_INDICATOR,
Expand Down

0 comments on commit c4b18ed

Please sign in to comment.