@@ -11,7 +11,7 @@ import { AutoSizer, List as VirtualList, InfiniteLoader } from 'react-virtualize
11
11
import { withProps , compose , withState } from 'recompose' ;
12
12
import { actions as routerActions } from 'redux-router5' ;
13
13
import 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' ;
15
15
import { queryStringToQuery } from 'ui/redux/modules/search' ;
16
16
import { withSchema } from 'ui/utils/hocs' ;
17
17
import Spinner from 'ui/components/Spinner' ;
@@ -27,6 +27,7 @@ class Home extends Component {
27
27
fetchMore : PropTypes . func ,
28
28
modelCount : PropTypes . number ,
29
29
logout : PropTypes . func ,
30
+ orgLogout : PropTypes . func ,
30
31
orgLoginStart : PropTypes . func ,
31
32
navigateTo : PropTypes . func ,
32
33
isSiteAdmin : PropTypes . bool ,
@@ -42,6 +43,10 @@ class Home extends Component {
42
43
isSiteAdmin : false
43
44
}
44
45
46
+ componentDidMount = ( ) => {
47
+ this . props . orgLogout ( ) ;
48
+ }
49
+
45
50
onOrgSearch = ( event ) => {
46
51
this . props . setOrgSearch ( event . target . value ) ;
47
52
}
@@ -254,7 +259,7 @@ export default compose(
254
259
auth : authenticationSelector ( state ) ,
255
260
authUser : loggedInUserSelector ( state ) ,
256
261
isSiteAdmin : isSiteAdminSelector ( state )
257
- } ) , { logout, orgLoginStart, navigateTo : routerActions . navigateTo } ) ,
262
+ } ) , { logout, orgLoginStart, orgLogout , navigateTo : routerActions . navigateTo } ) ,
258
263
withState ( 'orgSearch' , 'setOrgSearch' , '' ) ,
259
264
withProps ( ( { authUser, orgSearch } ) => {
260
265
const userOrgs = authUser . get ( 'organisations' , new ImmutList ( ) ) ;
0 commit comments