From 76cbaf6bc07480f897079ae40699addc1742972a Mon Sep 17 00:00:00 2001 From: Rupesh Parab Date: Thu, 23 Jul 2020 20:18:43 +0530 Subject: [PATCH] #1206 - move paramters from user details event to custom attributes --- src/components/index.js | 7 ++++++- src/redux/userProfile/sagas.js | 26 ++------------------------ src/services/mathshare.js | 11 +++++++++++ 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/components/index.js b/src/components/index.js index 2ecb74ee..669cacbc 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -55,6 +55,7 @@ import keyMap from '../constants/hotkeyConfig.json'; import { stopEvent, passEventForKeys } from '../services/events'; import { getPathTo } from '../services/dom'; import './styles.scss'; +import { getFormattedUserType } from '../services/mathshare'; const mathLive = process.env.MATHLIVE_DEBUG_MODE @@ -468,11 +469,15 @@ class App extends Component { modal, problemList, problemStore, userProfile, } = this.props; const { email, name } = userProfile; + const { userType, role, grades } = userProfile.info; const intercomAttributes = { user_id: email, email, name, + userType: getFormattedUserType(userType), + userRole: role, + grades, }; return ( @@ -568,7 +573,7 @@ class App extends Component { } /> - {['teacher', 'other'].includes(userProfile.info.userType) && } + {['teacher', 'other'].includes(userType) && }