Skip to content

Commit

Permalink
update naming convention for analytics consts
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed Feb 6, 2024
1 parent a770ed5 commit ac882a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/src/pages/EmergencyStop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const ESTOP_STATUS_REFETCH_INTERVAL_MS = 10000
export function EmergencyStop(): JSX.Element {
const { i18n, t } = useTranslation(['device_settings', 'shared'])
const history = useHistory()
const seen = useSelector(getAnalyticsOptInSeen)
const hasOptedIn = useSelector(getAnalyticsOptedIn)
const seenOptIn = useSelector(getAnalyticsOptInSeen)
const optedIn = useSelector(getAnalyticsOptedIn)

// Note here the touchscreen app is using status since status is linked to EstopPhysicalStatuses
// left notPresent + right disengaged => disengaged
Expand Down Expand Up @@ -106,7 +106,7 @@ export function EmergencyStop(): JSX.Element {
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
disabled={!isEstopConnected}
onClick={() => {
seen && hasOptedIn
seenOptIn && optedIn
? history.push('/robot-settings/rename-robot')
: history.push('/privacy-policy')
}}
Expand Down
8 changes: 4 additions & 4 deletions app/src/pages/PrivacyPolicy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ export function PrivacyPolicy(): JSX.Element {
const history = useHistory()
const dispatch = useDispatch<Dispatch>()
const isUnboxingFlowOngoing = useIsUnboxingFlowOngoing()
const hasOptedIn = useSelector(getAnalyticsOptedIn)
const seen = useSelector(getAnalyticsOptInSeen)
const seenOptedIn = useSelector(getAnalyticsOptInSeen)
const optedIn = useSelector(getAnalyticsOptedIn)

Check warning on line 39 in app/src/pages/PrivacyPolicy/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/pages/PrivacyPolicy/index.tsx#L34-L39

Added lines #L34 - L39 were not covered by tests

const handleAgree = (): void => {
dispatch(setAnalyticsOptInSeen())
dispatch(toggleAnalyticsOptedIn())

Check warning on line 43 in app/src/pages/PrivacyPolicy/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/pages/PrivacyPolicy/index.tsx#L41-L43

Added lines #L41 - L43 were not covered by tests
}

React.useEffect(() => {

Check warning on line 46 in app/src/pages/PrivacyPolicy/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/pages/PrivacyPolicy/index.tsx#L46

Added line #L46 was not covered by tests
if (hasOptedIn && seen) {
if (seenOptedIn && optedIn) {
if (isUnboxingFlowOngoing) {
history.push('/robot-settings/rename-robot')

Check warning on line 49 in app/src/pages/PrivacyPolicy/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/pages/PrivacyPolicy/index.tsx#L49

Added line #L49 was not covered by tests
} else {
history.push('/dashboard')

Check warning on line 51 in app/src/pages/PrivacyPolicy/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/pages/PrivacyPolicy/index.tsx#L51

Added line #L51 was not covered by tests
}
}
}, [hasOptedIn, seen])
}, [seenOptedIn, optedIn])

return (

Check warning on line 56 in app/src/pages/PrivacyPolicy/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/pages/PrivacyPolicy/index.tsx#L56

Added line #L56 was not covered by tests
<>
Expand Down

0 comments on commit ac882a0

Please sign in to comment.