diff --git a/src/components/PasswordGenerator.vue b/src/components/PasswordGenerator.vue index d377776..7bd9f16 100644 --- a/src/components/PasswordGenerator.vue +++ b/src/components/PasswordGenerator.vue @@ -215,7 +215,6 @@ fetchPasswords(){ Passwords.all().then(response => { this.passwords = response.data.results; - this.$store.dispatch('setPasswords', response.data.results); }); }, fetchPassword(id){ diff --git a/src/store.js b/src/store.js index 722ff24..8197df6 100644 --- a/src/store.js +++ b/src/store.js @@ -10,17 +10,12 @@ const auth = new Auth(storage); const state = { authenticated: auth.isAuthenticated(), - email: '', - passwords: [] + email: '' }; const mutations = { - setPasswords(state, passwords){ - state.passwords = passwords - }, logout(state){ state.authenticated = false; - state.passwords = []; }, userAuthenticated(state, user){ state.authenticated = true; @@ -33,14 +28,12 @@ const actions = { logout: ({commit}) => { auth.logout(); commit('logout'); - }, - setPasswords: ({commit}, password) => commit('setPasswords', password), + } }; const getters = { isAuthenticated: state => state.authenticated, isGuest: state => !state.authenticated, - passwords: state => state.passwords, email: state => state.email, baseURL: state => state.baseURL };