Properly cast null value from session storage
This commit is contained in:
@@ -8,7 +8,7 @@ const guard = (to, from, next) => {
|
||||
if (store.state.loading) {
|
||||
next(false);
|
||||
} else if (store.state.loggedIn) {
|
||||
if (to.meta.requiresTeamer && !store.state.teamer) {
|
||||
if (to.meta.requiresTeamer && !store.state.isTeamer) {
|
||||
next(false);
|
||||
} else {
|
||||
next();
|
||||
|
||||
@@ -27,7 +27,7 @@ export default new Vuex.Store({
|
||||
config: config,
|
||||
loading: false,
|
||||
loggedIn: !!sessionStorage.getItem('token'),
|
||||
teamer: !!sessionStorage.getItem('teamerId'),
|
||||
isTeamer: JSON.parse(sessionStorage.getItem('teamerId')) !== null,
|
||||
countries: [],
|
||||
abilities: [],
|
||||
timeFrames: [],
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
return this.$store.state.loggedIn;
|
||||
},
|
||||
isTeamer () {
|
||||
return this.$store.state.teamer;
|
||||
return this.$store.state.isTeamer;
|
||||
},
|
||||
loaderUrl () {
|
||||
return this.$store.state.config.loaderUrl;
|
||||
|
||||
Reference in New Issue
Block a user