@@ -11,11 +11,9 @@ import { loggedInUserIdSelector, accessTokenSelector } from '../../redux/selecto
1111import { fetchUserIfNeeded } from '../../redux/modules/users.js' ;
1212import { fetchUserStatus } from '../../redux/selectors/users.js' ;
1313import { isTokenValid , isTokenInNeedOfRefreshment } from '../../redux/helpers/token' ;
14- import { addNotification } from '../../redux/modules/notifications.js' ;
1514import { logout , refresh } from '../../redux/modules/auth.js' ;
1615import { resourceStatus } from '../../redux/helpers/resourceManager' ;
1716import { suspendAbortPendingRequestsOptimization } from '../../pages/routes.js' ;
18- import { SESSION_EXPIRED_MESSAGE } from '../../redux/helpers/api/tools.js' ;
1917import withRouter , { withRouterProps } from '../../helpers/withRouter.js' ;
2018
2119import './siscodex.css' ;
@@ -69,20 +67,18 @@ class App extends Component {
6967 * must be checked more often.
7068 */
7169 checkAuthentication = ( ) => {
72- const { isLoggedIn, accessToken, refreshToken, logout, addNotification } = this . props ;
70+ const { isLoggedIn, accessToken, refreshToken, logout } = this . props ;
7371
7472 const token = accessToken ? accessToken . toJS ( ) : null ;
7573 if ( isLoggedIn ) {
7674 if ( ! isTokenValid ( token ) ) {
7775 logout ( ) ;
78- addNotification ( SESSION_EXPIRED_MESSAGE , false ) ;
7976 } else if ( isTokenInNeedOfRefreshment ( token ) && ! this . isRefreshingToken ) {
8077 suspendAbortPendingRequestsOptimization ( ) ;
8178 this . isRefreshingToken = true ;
8279 refreshToken ( )
8380 . catch ( ( ) => {
8481 logout ( ) ;
85- addNotification ( SESSION_EXPIRED_MESSAGE , false ) ;
8682 } )
8783 . then ( ( ) => {
8884 this . isRefreshingToken = false ;
@@ -104,7 +100,6 @@ App.propTypes = {
104100 loadAsync : PropTypes . func . isRequired ,
105101 refreshToken : PropTypes . func . isRequired ,
106102 logout : PropTypes . func . isRequired ,
107- addNotification : PropTypes . func . isRequired ,
108103 location : withRouterProps . location ,
109104} ;
110105
@@ -123,7 +118,6 @@ export default withRouter(
123118 loadAsync : userId => App . loadAsync ( { } , dispatch , { userId } ) ,
124119 refreshToken : ( ) => dispatch ( refresh ( ) ) ,
125120 logout : ( ) => dispatch ( logout ( ) ) ,
126- addNotification : ( msg , successful ) => dispatch ( addNotification ( msg , successful ) ) ,
127121 } )
128122 ) ( App )
129123) ;
0 commit comments