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 (
4444 componentWillMount ( ) {
4545 const { checkLogin, fetchAppInfo, user} = this . props
4646 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.
4749 fetchAppInfo ( )
48- checkLogin ( userIsLoggedIn )
49- if ( userIsLoggedIn ) {
50- this . _checkIfAdmin ( )
51- }
50+ . then ( ( ) => {
51+ checkLogin ( userIsLoggedIn )
52+ if ( userIsLoggedIn ) {
53+ this . _checkIfAdmin ( )
54+ }
55+ } )
5256 }
5357
5458 componentWillReceiveProps ( nextProps ) {
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export function checkJobStatus () {
115115 * commits, the repo URL, and the specific configuration used by the backend
116116 * server.
117117 */
118- export function fetchAppInfo ( ) {
118+ export async function fetchAppInfo ( ) {
119119 return async function ( dispatch : dispatchFn , getState : getStateFn ) {
120120 // fetch info. If an error occurs or response json doesn't match, set
121121 // server info to value indicating an unknown commit and repoUrl
You can’t perform that action at this time.
0 commit comments