Skip to content

Commit d300d7e

Browse files
author
Parth Shah
committed
fixing lint issues and minor fixes
1 parent 726c83c commit d300d7e

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

src/actions/loadUser.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import _ from 'lodash'
2-
// import { fetchJSON } from '../helpers'
32
import { ACCOUNTS_APP_CONNECTOR_URL, LOAD_USER_SUCCESS, LOAD_USER_FAILURE, ROLE_ADMINISTRATOR, ROLE_CONNECT_COPILOT, ROLE_TOPCODER_USER, ROLE_CONNECT_MANAGER } from '../config/constants'
43
import { getFreshToken, configureConnector, decodeToken } from 'tc-accounts'
54
import { getUserProfile } from '../api/users'
@@ -44,7 +43,7 @@ export function loadUserSuccess(dispatch, token) {
4443
// keeping profile for backward compaitability
4544
currentUser.profile = profile
4645
// determine user role
47-
let userRole;
46+
let userRole
4847
if (_.indexOf(currentUser.roles, ROLE_ADMINISTRATOR) > -1) {
4948
userRole = ROLE_ADMINISTRATOR
5049
} else if (_.indexOf(currentUser.roles, ROLE_CONNECT_MANAGER) > -1) {
@@ -56,7 +55,7 @@ export function loadUserSuccess(dispatch, token) {
5655
}
5756

5857

59-
const analyticsEvents = [
58+
const analyticsEvents = [{
6059
eventType: EventTypes.identify,
6160
eventPayload: {
6261
userId: currentUser.id,
@@ -70,12 +69,12 @@ export function loadUserSuccess(dispatch, token) {
7069
createdAt: currentUser.createdAt
7170
}
7271
}
73-
]
74-
if (analytics) {
75-
const anonymousId = analtyics.user().anonymousId()
72+
}]
73+
if (window.analytics) {
74+
const anonymousId = window.analtyics.user().anonymousId()
7675
if (anonymousId) {
7776
analyticsEvents.push({
78-
eventType: EventType.alias,
77+
eventType: EventTypes.alias,
7978
eventPayload: {
8079
userId: currentUser.id,
8180
previousId: anonymousId

src/components/TopBar/TopBar.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ class TopBar extends Component {
5858
const logoTargetUrl = isLoggedIn ? '/projects' : '/'
5959

6060
const logoutClick = () => {
61-
console.log('Before ID', analytics.user().anonymousId())
62-
analytics.reset()
63-
console.log('After ID', analytics.user().anonymousId())
61+
window.analytics.reset()
6462
window.location = logoutLink
6563

6664
}

src/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Router from 'react-router/lib/Router'
88
import store from './config/store'
99
import routes from './routes'
1010
import { TCEmitter } from './helpers'
11-
import { EVENT_ROUTE_CHANGE, HEAP_ANALYTICS_APP_ID, SEGMENT_KEY } from './config/constants'
11+
import { EVENT_ROUTE_CHANGE, SEGMENT_KEY } from './config/constants'
1212

1313
const mountNode = document.getElementById('root')
1414
const onRouteChange = () => {

src/routes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getFreshToken } from 'tc-accounts'
1414
// import reportsListRoutes from './reports/routes.jsx'
1515

1616
// Tracking
17-
browserHistory.listen( location => {
17+
browserHistory.listen( () => {
1818
if (window.analytics) {
1919
window.analytics.page()
2020
}

0 commit comments

Comments
 (0)