Remove superfluous getters from store

This commit is contained in:
Björn Fromme
2018-10-17 08:00:35 +02:00
parent 3b6b73cf91
commit f26efcb232
7 changed files with 9 additions and 15 deletions
@@ -5,9 +5,9 @@ import store from './_store';
Vue.use(VueRouter);
const guard = (to, from, next) => {
if (store.getters.isLoading) {
if (store.state.loading) {
next(false);
} else if (store.getters.isLoggedIn) {
} else if (store.state.loggedIn) {
next();
} else {
next({ name: 'login' });
@@ -26,7 +26,7 @@ export default new VueRouter({
path: '/',
component: Login,
beforeEnter (from, to, next) {
if (!store.getters.isLoggedIn) {
if (!store.state.loggedIn) {
next();
} else {
next({ name: 'address' });
@@ -152,12 +152,6 @@ export default new Vuex.Store({
}
},
getters: {
isLoading: state => {
return state.loading;
},
isLoggedIn: state => {
return state.loggedIn;
},
authToken () {
return sessionStorage.getItem('token')
}
@@ -150,7 +150,7 @@
return this.$store.state.countries;
},
loading () {
return this.$store.getters.isLoading;
return this.$store.state.loading;
}
}
}
@@ -39,13 +39,13 @@
},
computed: {
isLoggedIn () {
return this.$store.getters.isLoggedIn;
return this.$store.state.loggedIn;
},
loaderUrl () {
return this.$store.state.config.loaderUrl;
},
loading () {
return this.$store.getters.isLoading;
return this.$store.state.loading;
}
},
created () {
@@ -83,7 +83,7 @@
return this.$store.state.config.loaderUrl;
},
loading () {
return this.$store.getters.isLoading;
return this.$store.state.loading;
}
}
}
@@ -93,7 +93,7 @@
return this.$store.state.config.loaderUrl;
},
loading () {
return this.$store.getters.isLoading;
return this.$store.state.loading;
}
}
}
@@ -60,7 +60,7 @@
return this.$store.state.config.loaderUrl;
},
loading () {
return this.$store.getters.isLoading;
return this.$store.state.loading;
}
}
}