Skip to content

Commit

Permalink
fix: eid check inside mixpanel profile properties and superProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-mazz committed Oct 22, 2024
1 parent f2bbee8 commit 837436b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
14 changes: 7 additions & 7 deletions ts/mixpanelConfig/profileProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { GlobalState } from "../store/reducers/types";
import { LoginSessionDuration } from "../features/fastLogin/analytics/optinAnalytics";
import { BiometricsType, getBiometricsType } from "../utils/biometrics";
import {
getNotificationPermissionType,
NotificationPermissionType,
NotificationPreferenceConfiguration,
ServiceConfigurationTrackingType,
getNotificationPermissionType
ServiceConfigurationTrackingType
} from "../screens/profile/analytics";
import { idpSelector } from "../store/reducers/authentication";
import { tosVersionSelector } from "../store/reducers/profile";
Expand All @@ -25,12 +25,12 @@ import {
itwCredentialsSelector
} from "../features/itwallet/credentials/store/selectors";
import {
MixpanelOptInTrackingType,
Property,
PropertyToUpdate,
loginSessionConfigHandler,
mixpanelOptInHandler,
MixpanelOptInTrackingType,
notificationConfigurationHandler,
Property,
PropertyToUpdate,
serviceConfigHandler
} from "./mixpanelPropertyUtils";

Expand Down Expand Up @@ -121,12 +121,12 @@ const tosVersionHandler = (state: GlobalState): number | string => {

const walletStatusHandler = (state: GlobalState): ItwStatus => {
const credentialsState = itwCredentialsSelector(state);
return credentialsState.eid ? "L2" : "not_active";
return O.isSome(credentialsState.eid) ? "L2" : "not_active";
};

const idStatusHandler = (state: GlobalState): ItwId => {
const credentialsState = itwCredentialsSelector(state);
return credentialsState.eid ? "valid" : "not_available";
return O.isSome(credentialsState.eid) ? "valid" : "not_available";
};
const pgStatusHandler = (state: GlobalState): ItwPg => {
const credentialsByType = itwCredentialsByTypeSelector(state);
Expand Down
13 changes: 7 additions & 6 deletions ts/mixpanelConfig/superProperties.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Appearance, ColorSchemeName } from "react-native";
import * as O from "fp-ts/Option";
import { isScreenReaderEnabled } from "../utils/accessibility";
import { getAppVersion } from "../utils/appVersion";
import {
Expand All @@ -7,10 +8,10 @@ import {
} from "../utils/device";
import { BiometricsType, getBiometricsType } from "../utils/biometrics";
import {
getNotificationPermissionType,
NotificationPermissionType,
NotificationPreferenceConfiguration,
ServiceConfigurationTrackingType,
getNotificationPermissionType
ServiceConfigurationTrackingType
} from "../screens/profile/analytics";

import { GlobalState } from "../store/reducers/types";
Expand All @@ -30,10 +31,10 @@ import {
itwCredentialsSelector
} from "../features/itwallet/credentials/store/selectors";
import {
Property,
PropertyToUpdate,
loginSessionConfigHandler,
notificationConfigurationHandler,
Property,
PropertyToUpdate,
serviceConfigHandler
} from "./mixpanelPropertyUtils";

Expand Down Expand Up @@ -113,12 +114,12 @@ const forceUpdate = <T extends keyof SuperProperties>(

const walletStatusHandler = (state: GlobalState): ItwStatus => {
const credentialsState = itwCredentialsSelector(state);
return credentialsState.eid ? "L2" : "not_active";
return O.isSome(credentialsState.eid) ? "L2" : "not_active";
};

const idStatusHandler = (state: GlobalState): ItwId => {
const credentialsState = itwCredentialsSelector(state);
return credentialsState.eid ? "valid" : "not_available";
return O.isSome(credentialsState.eid) ? "valid" : "not_available";
};
const pgStatusHandler = (state: GlobalState): ItwPg => {
const credentialsByType = itwCredentialsByTypeSelector(state);
Expand Down

0 comments on commit 837436b

Please sign in to comment.