@@ -11,7 +11,7 @@ import { AutoSizer, List as VirtualList, InfiniteLoader } from 'react-virtualize
1111import { withProps , compose , withState } from 'recompose' ;
1212import { actions as routerActions } from 'redux-router5' ;
1313import moment from 'moment' ;
14- import { isSiteAdminSelector , authenticationSelector , logout , orgLoginStart , loggedInUserSelector } from 'ui/redux/modules/auth' ;
14+ import { isSiteAdminSelector , authenticationSelector , logout , orgLoginStart , loggedInUserSelector , orgLogout } from 'ui/redux/modules/auth' ;
1515import { queryStringToQuery } from 'ui/redux/modules/search' ;
1616import { withSchema } from 'ui/utils/hocs' ;
1717import Spinner from 'ui/components/Spinner' ;
@@ -27,6 +27,7 @@ class Home extends Component {
2727 fetchMore : PropTypes . func ,
2828 modelCount : PropTypes . number ,
2929 logout : PropTypes . func ,
30+ orgLogout : PropTypes . func ,
3031 orgLoginStart : PropTypes . func ,
3132 navigateTo : PropTypes . func ,
3233 isSiteAdmin : PropTypes . bool ,
@@ -42,6 +43,10 @@ class Home extends Component {
4243 isSiteAdmin : false
4344 }
4445
46+ componentDidMount = ( ) => {
47+ this . props . orgLogout ( ) ;
48+ }
49+
4550 onOrgSearch = ( event ) => {
4651 this . props . setOrgSearch ( event . target . value ) ;
4752 }
@@ -254,7 +259,7 @@ export default compose(
254259 auth : authenticationSelector ( state ) ,
255260 authUser : loggedInUserSelector ( state ) ,
256261 isSiteAdmin : isSiteAdminSelector ( state )
257- } ) , { logout, orgLoginStart, navigateTo : routerActions . navigateTo } ) ,
262+ } ) , { logout, orgLoginStart, orgLogout , navigateTo : routerActions . navigateTo } ) ,
258263 withState ( 'orgSearch' , 'setOrgSearch' , '' ) ,
259264 withProps ( ( { authUser, orgSearch } ) => {
260265 const userOrgs = authUser . get ( 'organisations' , new ImmutList ( ) ) ;
0 commit comments