@@ -16,7 +16,7 @@ import { getFreshToken, decodeToken } from 'tc-auth-lib'
16
16
import { saveToken } from './actions/auth'
17
17
import { loadChallengeDetails } from './actions/challenges'
18
18
import { connect } from 'react-redux'
19
- import { checkAllowedRoles , checkReadOnlyRoles } from './util/tc'
19
+ import { checkAllowedRoles , checkOnlyReadOnlyRoles , checkReadOnlyRoles } from './util/tc'
20
20
import { setCookie , removeCookie , isBetaMode } from './util/cookie'
21
21
import IdleTimer from 'react-idle-timer'
22
22
import modalStyles from './styles/modal.module.scss'
@@ -38,7 +38,7 @@ class RedirectToChallenge extends React.Component {
38
38
39
39
componentWillReceiveProps ( nextProps ) {
40
40
const { token } = nextProps
41
- const isReadOnly = checkReadOnlyRoles ( token )
41
+ const isReadOnly = checkOnlyReadOnlyRoles ( token )
42
42
const projectId = _ . get ( nextProps . challengeDetails , 'projectId' )
43
43
const challengeId = _ . get ( nextProps . challengeDetails , 'id' )
44
44
if ( projectId && challengeId && isReadOnly ) {
@@ -52,8 +52,9 @@ class RedirectToChallenge extends React.Component {
52
52
}
53
53
}
54
54
55
- let mapStateToProps = ( { challenges : { challengeDetails } } ) => ( {
56
- challengeDetails
55
+ let mapStateToProps = ( { challenges : { challengeDetails } , auth } ) => ( {
56
+ challengeDetails,
57
+ ...auth
57
58
} )
58
59
59
60
let mapDispatchToProps = {
0 commit comments