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) {
|
if (store.state.loading) {
|
||||||
next(false);
|
next(false);
|
||||||
} else if (store.state.loggedIn) {
|
} else if (store.state.loggedIn) {
|
||||||
if (to.meta.requiresTeamer && !store.state.teamer) {
|
if (to.meta.requiresTeamer && !store.state.isTeamer) {
|
||||||
next(false);
|
next(false);
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default new Vuex.Store({
|
|||||||
config: config,
|
config: config,
|
||||||
loading: false,
|
loading: false,
|
||||||
loggedIn: !!sessionStorage.getItem('token'),
|
loggedIn: !!sessionStorage.getItem('token'),
|
||||||
teamer: !!sessionStorage.getItem('teamerId'),
|
isTeamer: JSON.parse(sessionStorage.getItem('teamerId')) !== null,
|
||||||
countries: [],
|
countries: [],
|
||||||
abilities: [],
|
abilities: [],
|
||||||
timeFrames: [],
|
timeFrames: [],
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
return this.$store.state.loggedIn;
|
return this.$store.state.loggedIn;
|
||||||
},
|
},
|
||||||
isTeamer () {
|
isTeamer () {
|
||||||
return this.$store.state.teamer;
|
return this.$store.state.isTeamer;
|
||||||
},
|
},
|
||||||
loaderUrl () {
|
loaderUrl () {
|
||||||
return this.$store.state.config.loaderUrl;
|
return this.$store.state.config.loaderUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user