# HG changeset patch # User Thomas Junk # Date 1529316695 -7200 # Node ID 361ae8211991d591786b65836d07cd57f1863781 # Parent ee6d3836014eb1524bf6c25538cee1c42c187fff refactored to component local state diff -r ee6d3836014e -r 361ae8211991 src/stores/application.js --- a/src/stores/application.js Fri Jun 15 13:04:07 2018 +0200 +++ b/src/stores/application.js Mon Jun 18 12:11:35 2018 +0200 @@ -2,8 +2,7 @@ namespaced: true, state: { appTitle: process.env.VUE_APP_TITLE, - secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL, - loginFailed: false + secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL }, getters: { appTitle: state => { @@ -11,19 +10,9 @@ }, secondaryLogo: state => { return state.secondaryLogo; - }, - loginFailed: state => { - return state.loginFailed; } }, - mutations: { - loginError(state) { - state.loginFailed = true; - }, - loginSuccess(state) { - state.loginFailed = false; - } - }, + mutations: {}, actions: {} }; diff -r ee6d3836014e -r 361ae8211991 src/views/Login.vue --- a/src/views/Login.vue Fri Jun 15 13:04:07 2018 +0200 +++ b/src/views/Login.vue Mon Jun 18 12:11:35 2018 +0200 @@ -57,11 +57,12 @@ return { username: "", password: "", - submitted: false + submitted: false, + loginFailed: false }; }, computed: { - ...mapGetters("application", ["appTitle", "loginFailed", "secondaryLogo"]), + ...mapGetters("application", ["appTitle", "secondaryLogo"]), ...mapGetters("i18n", [ "signinHeader", "emailLabel", @@ -78,11 +79,11 @@ this.$store .dispatch("user/login", { username, password }) .then(() => { - this.$store.commit("application/loginSuccess"); + this.loginFailed = false; this.$router.push("/"); }) .catch(() => { - this.$store.commit("application/loginError"); + this.loginFailed = true; this.submitted = false; }); }