@@ -18,9 +18,12 @@ import {RemoteDataState, AppState} from 'src/types'
1818
1919// Actions
2020import { getOrganizations } from 'src/organizations/actions/thunks'
21- import { getQuartzMe } from 'src/me/actions/thunks'
21+ import { getQuartzMe as apiGetQuartzMe } from 'src/me/actions/thunks'
2222import RouteToOrg from 'src/shared/containers/RouteToOrg'
2323
24+ // Selectors
25+ import { getQuartzMe } from 'src/me/selectors'
26+
2427// Constants
2528import { CLOUD } from 'src/shared/constants'
2629
@@ -43,7 +46,7 @@ const GetOrganizations: FunctionComponent = () => {
4346 const quartzMeStatus = useSelector (
4447 ( state : AppState ) => state . me . quartzMeStatus
4548 )
46- const me = useSelector ( ( state : AppState ) => state . me . quartzMe )
49+ const me = useSelector ( getQuartzMe )
4750 const dispatch = useDispatch ( )
4851 useEffect ( ( ) => {
4952 if ( status === RemoteDataState . NotStarted ) {
@@ -56,9 +59,18 @@ const GetOrganizations: FunctionComponent = () => {
5659 isFlagEnabled ( 'uiUnificationFlag' ) &&
5760 quartzMeStatus === RemoteDataState . NotStarted
5861 ) {
59- dispatch ( getQuartzMe ( ) )
62+ dispatch ( apiGetQuartzMe ( ) )
63+ }
64+
65+ if (
66+ isFlagEnabled ( 'credit250Experiment' ) &&
67+ quartzMeStatus === RemoteDataState . Done
68+ ) {
69+ const { accountCreatedAt = '' } = me
70+ window . dataLayer = window . dataLayer ?? [ ]
71+ window . dataLayer . push ( { accountCreatedAt} )
6072 }
61- } , [ dispatch , quartzMeStatus ] )
73+ } , [ dispatch , me , quartzMeStatus ] )
6274
6375 return (
6476 < PageSpinner loading = { status } >
0 commit comments