Properly cast null value from session storage

This commit is contained in:
Björn Fromme
2018-11-27 11:17:10 +01:00
parent 71a454c716
commit 60c76dc717
3 changed files with 3 additions and 3 deletions
@@ -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;