Skip to content

Commit

Permalink
LIVE-4036 - LLM - Analytics added firstConnectHasDeviceUpdated prop
Browse files Browse the repository at this point in the history
  • Loading branch information
LFBarreto committed Nov 9, 2022
1 parent 25a4e5c commit 7be1afc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-chairs-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Analytics - added firstConnectHasDeviceUpdated property
6 changes: 5 additions & 1 deletion apps/ledger-live-mobile/src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ export type SettingsSetFirstConnectionHasDevicePayload = Pick<
SettingsState,
"firstConnectionHasDevice"
>;
export type SettingsSetFirstConnectHasDeviceUpdatedPayload = Pick<
SettingsState,
"firstConnectHasDeviceUpdated"
>;
export type SettingsSetNotificationsPayload = {
notifications: Partial<SettingsState["notifications"]>;
};
Expand Down Expand Up @@ -414,7 +418,7 @@ export type SettingsPayload =
| SettingsSetMarketCounterCurrencyPayload
| SettingsSetMarketFilterByStarredAccountsPayload
| SettingsSetSensitiveAnalyticsPayload
| SettingsSetFirstConnectionHasDevicePayload
| SettingsSetFirstConnectHasDeviceUpdatedPayload
| SettingsSetNotificationsPayload
| SettingsDangerouslyOverrideStatePayload;

Expand Down
4 changes: 4 additions & 0 deletions apps/ledger-live-mobile/src/analytics/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
lastSeenDeviceSelector,
sensitiveAnalyticsSelector,
firstConnectionHasDeviceSelector,
firstConnectHasDeviceUpdatedSelector,
readOnlyModeEnabledSelector,
hasOrderedNanoSelector,
} from "../reducers/settings";
Expand Down Expand Up @@ -73,6 +74,8 @@ const extraProperties = (store: AppStore) => {
}
: {};
const firstConnectionHasDevice = firstConnectionHasDeviceSelector(state);
const firstConnectHasDeviceUpdated =
firstConnectHasDeviceUpdatedSelector(state);

return {
appVersion,
Expand All @@ -87,6 +90,7 @@ const extraProperties = (store: AppStore) => {
sessionId,
devicesCount: devices.length,
firstConnectionHasDevice,
firstConnectHasDeviceUpdated,
...(satisfaction
? {
satisfaction,
Expand Down
11 changes: 7 additions & 4 deletions apps/ledger-live-mobile/src/reducers/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import type {
SettingsSetCountervaluePayload,
SettingsSetDiscreetModePayload,
SettingsSetExperimentalUsbSupportPayload,
SettingsSetFirstConnectionHasDevicePayload,
SettingsSetFirstConnectHasDeviceUpdatedPayload,
SettingsSetHasOrderedNanoPayload,
SettingsSetLanguagePayload,
SettingsSetLastConnectedDevicePayload,
Expand Down Expand Up @@ -136,6 +136,7 @@ export const INITIAL_STATE: SettingsState = {
marketFilterByStarredAccounts: false,
sensitiveAnalytics: false,
firstConnectionHasDevice: null,
firstConnectHasDeviceUpdated: null,
notifications: {
allowed: false,
transactions: false,
Expand Down Expand Up @@ -507,9 +508,9 @@ const handlers: ReducerMap<SettingsState, SettingsPayload> = {

[SettingsActionTypes.SET_FIRST_CONNECTION_HAS_DEVICE]: (state, action) => ({
...state,
firstConnectionHasDevice: (
action as Action<SettingsSetFirstConnectionHasDevicePayload>
).payload.firstConnectionHasDevice,
firstConnectHasDeviceUpdated: (
action as Action<SettingsSetFirstConnectHasDeviceUpdatedPayload>
).payload.firstConnectHasDeviceUpdated,
}),

[SettingsActionTypes.SET_NOTIFICATIONS]: (state, action) => ({
Expand Down Expand Up @@ -719,5 +720,7 @@ export const sensitiveAnalyticsSelector = (state: State) =>
state.settings.sensitiveAnalytics;
export const firstConnectionHasDeviceSelector = (state: State) =>
state.settings.firstConnectionHasDevice;
export const firstConnectHasDeviceUpdatedSelector = (state: State) =>
state.settings.firstConnectHasDeviceUpdated;
export const notificationsSelector = (state: State) =>
state.settings.notifications;
1 change: 1 addition & 0 deletions apps/ledger-live-mobile/src/reducers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export type SettingsState = {
marketFilterByStarredAccounts: boolean;
sensitiveAnalytics: boolean;
firstConnectionHasDevice: boolean | null;
firstConnectHasDeviceUpdated: boolean | null;
notifications: {
allowed: boolean;
transactions: boolean;
Expand Down

0 comments on commit 7be1afc

Please sign in to comment.