Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getMe = () => async dispatch => {
try {
dispatch(setMe(RemoteDataState.Loading))
const user = await client.users.me()
updateReportingContext({userID: user.id, userEmail: user.name})
gaEvent('cloudAppUserDataReady', {
identity: {
id: user.id,
email: user.name,
},
})
HoneyBadger.setContext({
user_id: user.id,
})
dispatch(setMe(RemoteDataState.Done, user as MeState))
} catch (error) {
console.error(error)
dispatch(setMe(RemoteDataState.Error))
}
}
export const getMe = () => async dispatch => {
try {
const user = await client.users.me()
updateReportingContext({userID: user.id, userEmail: user.name})
gaEvent('cloudAppUserDataReady', {
identity: {
id: user.id,
email: user.name,
},
})
updateReportingContext({
userID: user.id,
})
HoneyBadger.setContext({
user_id: user.id,
})
dispatch(setMe(user as MeState))
} catch (error) {
console.error(error)
}
}
export const setOrg = (org: Organization) => {
HoneyBadger.setContext({
orgID: org.id,
})
return {
type: SET_ORG,
org,
} as const
}