File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ import {GTM_USER_REMOVED} from 'src/users/constants'
3131// Types
3232import { CloudUser , DraftInvite , Invite , RemoteDataState } from 'src/types'
3333import { getOrg } from 'src/organizations/selectors'
34+ import { getMe } from 'src/me/selectors'
35+ import { CLOUD_URL } from 'src/shared/constants'
3436
3537export type Props = {
3638 children : JSX . Element
@@ -76,6 +78,8 @@ export const UsersContext = React.createContext<UsersContextType>(
7678export const UsersProvider : FC < Props > = React . memo ( ( { children} ) => {
7779 const dispatch = useDispatch ( )
7880 const orgId = useSelector ( getOrg ) ?. id
81+ const currentUserId = useSelector ( getMe ) ?. id
82+
7983 const [ users , setUsers ] = useState < CloudUser [ ] > ( [ ] )
8084 const [ invites , setInvites ] = useState < Invite [ ] > ( [ ] )
8185 const [ draftInvite , setDraftInvite ] = useState < DraftInvite > ( draft )
@@ -217,6 +221,10 @@ export const UsersProvider: FC<Props> = React.memo(({children}) => {
217221 window . dataLayer . push ( {
218222 event : GTM_USER_REMOVED ,
219223 } )
224+
225+ if ( userId == currentUserId ) {
226+ window . location . href = CLOUD_URL
227+ }
220228 } catch ( error ) {
221229 console . error ( error )
222230 dispatch ( notify ( removeUserFailed ( ) ) )
You can’t perform that action at this time.
0 commit comments