Skip to content

Commit

Permalink
Add CurrentCurrency to UserTraits object
Browse files Browse the repository at this point in the history
  • Loading branch information
gambinish committed Sep 9, 2024
1 parent 7e8cf3e commit 79ab492
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/scripts/controllers/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ export default class MetaMetricsController {
metamaskState.useTokenDetection,
[MetaMetricsUserTrait.UseNativeCurrencyAsPrimaryCurrency]:
metamaskState.useNativeCurrencyAsPrimaryCurrency,
[MetaMetricsUserTrait.CurrentCurrency]: metamaskState.currentCurrency,
///: BEGIN:ONLY_INCLUDE_IF(build-mmi)
[MetaMetricsUserTrait.MmiExtensionId]: this.extension?.runtime?.id,
[MetaMetricsUserTrait.MmiAccountAddress]: mmiAccountAddress,
Expand Down
6 changes: 5 additions & 1 deletion shared/constants/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ export enum MetaMetricsUserTrait {
MmiIsCustodian = 'mmi_is_custodian',
///: END:ONLY_INCLUDE_IF
PetnameAddressCount = 'petname_addresses_count',
/**
* Identified when the user selects a currency from settings
*/
CurrentCurrency = 'current_currency',
}

/**
Expand Down Expand Up @@ -514,7 +518,7 @@ export enum MetaMetricsEventName {
BridgeLinkClicked = 'Bridge Link Clicked',
BitcoinSupportToggled = 'Bitcoin Support Toggled',
BitcoinTestnetSupportToggled = 'Bitcoin Testnet Support Toggled',
CurrentCurrencyChanged = 'Selected Currency Changed',
CurrentCurrency = 'Current Currency',
DappViewed = 'Dapp Viewed',
DecryptionApproved = 'Decryption Approved',
DecryptionRejected = 'Decryption Rejected',
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/settings/settings-tab/settings-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ export default class SettingsTab extends PureComponent {
setCurrentCurrency(newCurrency);
this.context.trackEvent({
category: MetaMetricsEventCategory.Settings,
event: MetaMetricsEventName.CurrentCurrencyChanged,
sensitiveProperties: {
event: MetaMetricsEventName.CurrentCurrency,
properties: {
current_currency_changed: newCurrency,
},
});
Expand Down

0 comments on commit 79ab492

Please sign in to comment.