Removed redundant checkLoginStatus
@@ -216,14 +216,27 @@ export function accessControl({event, toState, toParams, fromState, fromParams,
break;
case 'landingpage': //Route the 'landingpage' view at all times
-
- checkLoginStatus()
- .then(() => {//logged in -- re-initiate route-change
+ if(
+ state.get('initialLoadFinished') && // no access control while still loading
+ getIn(state, ['user', 'loggedIn']))
+ {
+ //logged in -- re-initiate route-change
console.log("Admiral Ackbar mentioned that this would be a trap, so we will link you to the feed");
+ if(event) {
+ event.preventDefault()
+ } else {
dispatch(
- actionCreators.router__stateGoAbs('feed', toParams)
+ actionCreators.router__stateGoAbs('feed')
)
- });
+ }
+ }
+ //checkLoginStatus()
+ //.then(() => {//logged in -- re-initiate route-change
+ // console.log("Admiral Ackbar mentioned that this would be a trap, so we will link you to the feed");
+ // dispatch(
+ // actionCreators.router__stateGoAbs('feed', toParams)
+ // )
+ //});
break;
case 'signup':
@@ -237,7 +250,9 @@ export function accessControl({event, toState, toParams, fromState, fromParams,
return; // logged in. continue route-change as intended.
} else {
//sure to be logged out
- if(!event) {
+ if(event) {
+ event.preventDefault();
+ } else {
// this is a check with a route that's already fixed, redirect to landing page instead.
dispatch(
actionCreators.router__stateGoResetParams('landingpage')
