File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,15 @@ function wrapComponentInAuthStrategy (
44
44
componentWillMount ( ) {
45
45
const { checkLogin, fetchAppInfo, user} = this . props
46
46
const userIsLoggedIn : boolean = ! ! user . token
47
+ // Fetch app info before component mounts in order to ensure that checks
48
+ // for enabled modules result use the correct config data.
47
49
fetchAppInfo ( )
48
- checkLogin ( userIsLoggedIn )
49
- if ( userIsLoggedIn ) {
50
- this . _checkIfAdmin ( )
51
- }
50
+ . then ( ( ) => {
51
+ checkLogin ( userIsLoggedIn )
52
+ if ( userIsLoggedIn ) {
53
+ this . _checkIfAdmin ( )
54
+ }
55
+ } )
52
56
}
53
57
54
58
componentWillReceiveProps ( nextProps ) {
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export function checkJobStatus () {
115
115
* commits, the repo URL, and the specific configuration used by the backend
116
116
* server.
117
117
*/
118
- export function fetchAppInfo ( ) {
118
+ export async function fetchAppInfo ( ) {
119
119
return async function ( dispatch : dispatchFn , getState : getStateFn ) {
120
120
// fetch info. If an error occurs or response json doesn't match, set
121
121
// server info to value indicating an unknown commit and repoUrl
You can’t perform that action at this time.
0 commit comments