Skip to content

Commit

Permalink
feat: track enabled stake programs on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
beths-ledger committed Jan 16, 2025
1 parent 75f6e77 commit 87a5f86
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/ledger-live-mobile/src/analytics/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const getFeatureFlagProperties = () => {
(async () => {
const fetchAdditionalCoins = analyticsFeatureFlagMethod("fetchAdditionalCoins");
const stakingProviders = analyticsFeatureFlagMethod("ethStakingProviders");
const stakePrograms = analyticsFeatureFlagMethod("stakePrograms");

const isBatch1Enabled =
!!fetchAdditionalCoins?.enabled && fetchAdditionalCoins?.params?.batch === 1;
Expand All @@ -85,12 +86,22 @@ const getFeatureFlagProperties = () => {
!!fetchAdditionalCoins?.enabled && fetchAdditionalCoins?.params?.batch === 3;
const stakingProvidersEnabled =
stakingProviders?.enabled && stakingProviders?.params?.listProvider.length;
const stakingCurrenciesEnabled =
!stakePrograms?.params?.list?.length || !stakePrograms?.enabled
? {}
: Object.fromEntries(
stakePrograms?.params?.list?.map((currencyId: string) => [
`feature_earn_${currencyId}_enabled`,
true,
]),
);

updateIdentify({
isBatch1Enabled,
isBatch2Enabled,
isBatch3Enabled,
stakingProvidersEnabled,
...stakingCurrenciesEnabled,
});
})();
};
Expand Down

0 comments on commit 87a5f86

Please sign in to comment.